Cut already-installed trim / quarter round to mount bracket
The ideal device for cutting a close fit molding like this is an oscillating tool with a wood cutting blade. Here is a picture of the type of saw I am talking about with red arrow pointing to blade type for your application:



(Picture Source: https://www.lowes.com/pl/Rotary-tools-oscillating-tools-Power-tools-Tools/4294607824)

It may be possible for you to rent one of these tools if you do not already own one. Alternatively the molding can be cut using a hammer and very sharp wood chisel.

From looking at your picture it looks like the molding is paint locked in place so it may not be necessary to nail the remaining molding after you cut out the two slots. However you may want to be proactive and nail the ends of the molding near where the cuts will be made before doing any cutting. This step would be particularly valid if using the hammer and chisel cutting method because the pounding could dislodge the paint lock on the molding edge.