How about the following model for players (and AI?) resisting rising-civ-flips:
There will be a few stages for this.
STAGE 1: This is about four or five turns before the civ spawns. A dialog pops up: "My liege, many of our subjects in Jerusalem yearn to leave your control and join their brothers to the east, who are preparing to form a new kingdom! Shall we prepare to leave this city and let the damn rabble have what it wishes?" (This text would be variable-based of course, depending on your civics, the new civ's starting civics, location of city, and location of new civ's spawn.)
1a: Then if the player (/AI?) agrees, half the city's population dwindles away over three turns, a bunch of it randomly allocated to the player's other cities and maybe one or two pop just disappearing. For the first turns after agreeing to leave (until stage 2) the player may not bring units into the city or take them out (when you try you receive a popup: "My liege, if we pull those troops out all hell will break loose!" or "My liege, the people of Jerusalem will not tolerate us bringing new troops into the city at this point!").
1b: If the player refuses at stage one to leave the city (in the first dialog), it has a chance of, say, 15%*pop-5%*garrison to riot immediately. Also every turn for four turns it has a 50% of losing one pop, and there is a 25% chance that one garrison will be killed at random (no matter what unit it is.)
STAGE 2: This is the turn before the civ spawns.
2a: If the player chose to let the city go in stage 1, on the last turn before the flip and spawn, a popup comes up saying "My liege, our former subjects in Jerusalem are about to join their brothers from the east. We had better pull our troops out of there before they're overrun by their mobs!" If the player leaves their troops there at this point, there is a high chance (75%?) war is automatically declared with the new civ when it spawns, half the units flip over to it, and the rest die. There is also a -4 to relations ("You tried to keep our brethern under your control with your brutish army!" or something). There is also a slight chance (25%?) the city riots but stays under your control for now. If you really just let the city go you get +2 with the new civ ("You let our bretheren in your former city join us peacefully!")
2b: If you tried to keep the city in stage 1, the city riots (if it wasn't already rioting) and you receive a popup: "My liege, our subjects in Jerusalem are out of control! Are you sure we shouldn't just let the idiots go and have their new king?". If you let them go at this stage, you lose half your garrison in the city and the rest goes right outside the city, staying with full movement points. When the new civ forms the city flips and you get +1 with the new civ ("You let our bretheren join us after all.") If you still try to keep them, each unit in the city has say, 40% chance to just die, and the rest receive 5% damage per pop in the city. When the new civ spawns, you are at war with them and get -5, "How dare you try and control our people!?" but the city stays yours for now.
STAGE 3: This is one turn after the new civ spawns. You only get this far if you kept the city until now. City riots, 10% chance for each unit to die, all units get 5-25% damage, 10% of pop disappears, you get popup: "My liege, Jerusalem is going insane! The people there want to join those foul, foul Arabs, and they're attacking our troops! Maybe we should just let them go? It's hard to enough to fight those damn Arabs at our border, can we handle having them amongst us as well?" If you let them go, each unit you have there has a 10% chance of escaping to your border, and the rest either die or flip (50%-50%). The city flips.
If you don't let them go, again 10% chance for each unit to die, all units get 5-25% damage, 10% of pop disappears, but the city is yours for as long as you can hold it. And your diplomacy hit gets another -2.
How does all that sound to you? We can let the AI go through the same, using a random system based on leader personality. I think this kind of system would let players keep their cities if they really want, but it will be pretty damn hard. It also gives you a bit of a prize for letting it go right away in the form of keeping some of your pop. We can also probably make a few places here where you refuse to release the city also give the new civ pop and/or units to make it even harder.