I think the best way would be to use storage capacitor upstream the regulator, monitor voltage across it and from there command the shut down sequence. Then the whole design would be to ensure the main internal supply remains correct till the shut down sequence is complete and the output disconnected from the opamp (before anything active goes wild with collapsing supply).
I don't know what is the allowed minimum ramp up/ramp down time, for the relay you would need about 20ms, so we may be talking about some 50ms till 1s operation since the missing power feed alarm.
Dunno what is the power, but if we are talking about some 100mA at 24V supply, when starting from 48V or so, 40V would be the undervoltage trip point, minimum drop of the 24V regulator around 2V so minimum 26V on its input, we are talking about 1mF/63V capacitor for a shut down procedure taking 100ms and having undisturbed supply available for all the time (to not have to analyze what happens when the supply starts to collapse).
Does not sound to me as not doable...
Of course, use your spec numbers for the calculation...