AFAICT putting out relatively small hydrocarbon fires is done efficiently with water and foaming agents that cut off the air supply. As soon as the generator is not producing electricity, these measures can be used.
Batteries though cannot be switched off, and using water around serious electrical currents is a very, very dangerous idea. It's already much harder to put out a fire around lead-acid batteries, and nigh impossible with Lithium-based batteries.
This is where you need actual physical firewalls which can withstand fire for a long time and not let it through.
2. Especially in hot climates, inverters in the UPS need to be kept cool.
3. I assume that by keeping the UPS & batteries inside the building, you minimize transmission loss/voltage drops so you don't have to oversize your conductors.