LDO with supercap and diode circuit
Consider putting the capacitor (along with its inrush limiting resistor and discharging diode) before the LDO. You probably want to run the whole lot from another diode to prevent it trying to drive the 24V supply.

Then you can use a lower value capacitor, because it can sag from 24V to somewhere around 5V before the LDO regulator starts to notice. Its voltage rating has to be higher, though, so I can't say whether there is an overall cost saving.