In a proper democracy shit like this would lead to people voting for a party with the same values as the mayor but without the infighting. Hell, perhaps the mayor would even jump ship themself. This pressure then forces the corrupt party to either fix themselves or vanish.
In Germany we got enough parties so they can completely tank for a while for doing stupid shit, then recover organically. The Greens did that, The Left just recovered, the Libertarians… hopefully never recover. Well, except for the conservatives/right-wing 'cause old as well as pissed off people do not properly think about it anymore (conservatices just lose because old people are dying). An inherent issue with democracy you're completely at the mercy of.
A 2-Party system simply can't properly work.