Will this circuit function as an automatic supply changeover upon main supply failure?
This is how you do it:







simulate this circuit &ndash; Schematic created using CircuitLab

You can buy the "ideal diode" as a ready-made chip or create a small circuit yourself. It's basically a MOSFET which, unlike a PN diode, has a very small forward voltage drop. You may also use a normal PN or Schottky diode if you can live with the ~0.7V drop (likely for a 24V system).

The rectifier itself has two diodes going to battery plus, so no further diodes needed. The battery does the smoothing, so no smoothing cap needed.

EDIT: Charge controller added.
EDIT: Mains fuse added.