Why 12v batteries but not 110/240 corresponding with the mains?
Batteries are DC, not AC. When 240VAC is rectified to DC, the resulting voltage is higher by a factor of sqrt(2). So 240VAC becomes 340VDC after rectification. There is no way to make a battery that stores AC voltage.

A 12VDC Sealed Lead-Acid battery has 6 cells connected in series. If one cell fails, the entire battery fails. A high voltage battery is possible, but impacts reliability because more cells means more possible points of failure. For an Uninterruptible Power Supply, the big customers demand high uptime / long Mean Time Between Failures. More cells would also mean more weight. (Lead and Sulfuric Acid are some of the densest, heaviest commonly available materials.)

As far as capacity and runtime are concerned, the typical consumer-grade UPS is intended to run for 5-30 minutes to give enough time for the computer to finish shutdown or hibernate. Commercial UPS may work in conjunction with diesel generators, and only need to hold the load steady until the generator stabilizes

Another feature often found in UPS intended for data center, is multiple hot-swappable batteries. So if one battery fails, the operator can swap in a new battery without the need to power off the system or disconnect the load. This is practical with 12VDC SLA as they are lightweight enough for one person to safely pick up and move around.

High voltage circuits require stronger insulation, longer creepage clearance around the conductors. This adds to cost and weight.

Economy of scale is important. 12VDC SLA Batteries are widely available from many manufacturers, well characterized and with safety lab approvals (UL, CE, etc.). The motor vehicle industry and the home security industry use a lot of 12VDC SLA batteries, so this is already a commonly available voltage. Using a bespoke battery system incurs much higher NRE engineering costs, plus regulatory testing. Unless there is a compelling benefit, standard components are preferred.