UPS 12V power switching
Replace C1 with something like 10,000uF/25V and it should work. Eg. Panasonic ECO-S1EA103BA. 

You might have to add a small amount of resistance (such as another polyfuse in the 5A supply line) to keep the relay contacts from welding. 

You will also need a diode in series with the supply to keep the battery from back-feeding the relay coil.