Designing a low voltage UPS
Instead of a diode, use a relay.

Connect the coil across the capacitor, the normally open contact to the + side of the capacitor, the + side of the load to the common contact, and the battery + to the normally closed contact.

That way, with the mains hot the relay will be made and the capacitor + will be connected to the load through the relay's NO and COM contacts, but when the mains fail the cap will be disconnected from the load and the battery + will be connected to the load through the NC and COM terminals.

The main advantage in using the relay in this way is that there will be no voltage drop across the contacts and the load will be able to stay powered up longer than if the diode was used.