True no cities are prepared for this, but this is exactly the kind of thing distributed solar helps handle well - heat waves are almost always paired with sunshine. The more distributed solar you get on the grid, the less of an issue this becomes.
Yes, I know you still have power challenges at sunset while its still hot outside, but fortunately that's also when things tend to start cooling off, and you lose one major contributor to heat stress - solar radiation.
It's not a perfect system, batteries could of course help, but it's a major step in the right direction.