Emergency diesel generator is normally located on uppermost deck; and every naval ship has one.
But if it is not tested and maintained, it may not start in a blackout. Since it was reported that flooding came from exhaust, I assume generators had wet exhausts and one failed.