Are there other options when it rains? I imagine they're not dumping sewage into rivers for fun.
Portland, Oregon completed a project in 2011 that successfully eliminated almost all of the combined sewer overflows into the Willamette river and Columbia Slough (a swampy area on the south side of the Columbia river near the airport).
There was a ton of work done to reduce the amount of water ending up in the sewer during storms followed by some large infrastructure improvements to improve the carrying capacity of the sewer itself.
Dedicated stormwater infrastructure separate from sewage pipes solves the problem. You can also build tanks to hold overflow.
Not mixing sewers and rainwater drains is the usual choice.
In London the Thames Tideway Tunnel is designed to intercept and divert sewage overflows from the River Thames, particularly during heavy rainfall:
https://www.bbc.com/news/science-environment-68464798
I think there's a B1M episode on Youtube that has a good overview.
In DC, they're storing the combined runoff+sewage until it can be treated: https://dcist.com/story/23/09/18/new-anacostia-river-tunnel-...
As expensive as this project is, separating the storm drains from the sewage lines (https://en.wikipedia.org/wiki/Combined_sewer) in an existing system is much more costly.