Why should a UPS fail if the battery fails but the power from the wall outlet is still good?
I agree with Tim, but still Maintenance on replacing the battery could have avoided the failure.

To ensure the battery is good, it must be tested somehow or replaced if near 4 to 6 yr life span.

One may need to remove the battery or test it in-situ  while UPS has bypassed the AC to load and battery and inverter are not in use.


REF

THat's a lower cost hot switch UPS which takes 6 to 8 hrs to recharge the battery.  


1 cycle of stored energy in most PSU's means they can tolerate up to 1 cycle dropout of AC line voltage in both PC's and servers alike.


This means it does not have the power to even drive the inverter, unlike all laptop chargers which can operate without the battery. But those are only 65W.  In this cost-sensitive commodity adding power to drive the inverter is a lot more than just a 12V trickle charger.

Ideally, batteries are AGM also need to be pulse charged to reduce the possibility of sulfation, even if they say "sulphate-free".  

Battery choices also affect lifespan greatly.

The more expensive UPS types are continuous use inverters with a power supply that can drive both the inverter AND charge and monitor the health of the battery

Read here to see the doubler conversion or multi-mode UPS which cost a lot more. These operate from the inverter in continuous mode.
  - So there is no fast switching of input AC to AC inverter output on AC input failure to the inverter output