The built in charger for most UPS units has a few high value electrolytic capacitors right next to hot heatsinks, and replacing them, and all the smaller electrolytics around the hot parts, will probably fix the problem. The capacitors will have high ESR from being well toasted over the years, and the smaller ones will also be out of tolerance. As well they often are very much used outside ripple current ratings, often expecting a 1000uF 16V unit to have a 5A ripple current, while the data sheet says max ripple current is around 1A. You wonder which part is making the heat, the capacitor or the 12V battery regulator ( LM317 on a very small heatsink) or the 5W current limiting resistor all next to each other on the well browned board.
Do not forget as well the connections for the high current path might also have dry joints as well.