Normally the UPS power kicks in right away which uses its battery power to keep all the servers online, and this stays on until the datacenter (assuming it has all this equipment) gets its generator running whereupon the power is restored and the UPS begins re-charging and servers running normal.
Thats the theory, but I rarely see it happen like that (generators get neglected, UPS don't start properly/at all, power outages are horrible.