The easiest way, I think, is going to be a boost converter putting out 27V, then a linear regulator like LM317 or LM1117. You can drive the 'adjust' pin using an op amp; it'll put out 1.25V more than whatever you put in. The op amp can be controlled with a PWM DAC (just a PWM output from a microcontroller into a steep RC low pass filter). It's a bit trickier to make the boost converter programmable, but you don't need to. The device will most likely draw no more than 1mA (usually much less), so the amount of heat dissipated in the linear regulator is on the order of "who cares?".
TFYP: The voltage divider setting the output voltage usually serves as the 10mA minimum load on LM317. LM1117 has a minimum load of 5mA. If you're driving it with an op amp instead of using a voltage divider you'll need to put a resistor on the output to serve as the minimum load, or else it won't regulate correctly.
Hell, at that output current you could use the op amp output directly.
I wouldn't bother with a true rail monitor. You don't need to know how much current is being drawn. Just include a current limiter (you can do this with two transistors or so), programmable if you like, set to 2mA or similar, and some feedback into the MCU indicating whether it is actively limiting.
You don't even need a boost converter controller chip, since you're just feeding a linear regulator; you can drive a logic level MOSFET or an NPN transistor directly from the microcontroller.