Electric utilities provide appropriately higher levels of service and communication to hospitals. Hence there are protocols insuring hospitals don’t lose power in the way you are imagining. The people involved are serious competent professionals with extensive relevant experience, training, and education focused on safety and in touch with the specific facts of actual hospitals and utility grids.
There isn't much that they can do about storms knocking down wires, squirrels chewing a wire and knocking out a phase (other than taking down all phases). Which is why hospitals have several backup systems.