There is no easy solution to this. Building the sanitary sewers bigger is the obvious solution, except that costs more money and a lot of places don't have much money to spare (corruption, poverty, etc.) Furthermore, just how over-designed does a sanitary sewer have to be? Climate change makes this difficult to predict decades in advance.
BTW [intentionally] combined sewers are problematic even when they're not overflowing. Diluting sewage with a bunch of water increases the cost and decreases the efficacy of treatment.