When a ship is sinking, there are some who will abandon it quickly to save themselves. The phrase "like rats deserting a sinking ship" captures this image of those who flee in a moment of crisis. If you need to find a similar phrase or synonym to use in your writing, you might consider saying that people are "jumping ship" or "abandoning a sinking ship." Alternatively, you could say something like "fleeing in droves" or "scrambling for safety." Whatever words you choose, they should convey the sense of urgent flight and desperate escape from danger.