If you can afford to have the supply vary between 13.8V and 11.4V, for the primary and battery supplies, simply use two diodes, to 'mix' the two.
No relays, and no 'interruption' of the supply, when changing between the two (if that's important?)
Assuming you are using an SLA battery, which needs a constant voltage charge, you can provide a simple charger current limit with a polyfuse across the battery 'diode', and set the primary supply at 14.4V, to set the charging voltage.