What is the word that captures the attitude of escaping a circumstance when things seem to get hard or are going bad.
Traitor, weasel, chicken, deserter, opportunist - these words all have some nuances of a person who does not/can not follow through when the going gets hard or you need to depend on that person and they can't be found when the chips are down.
Precisely your title metaphor is captured in the traditional “rats deserting a sinking ship”.
bookbrowse.com gives this background:
Rats have been said to be the first to sense an impending disaster, such as a sinking ship or a gas leak in a mine—so if rats are seen leaving it's a good idea to follow!
Early records of this expression go back all the way to Pliny The Elder's *Natural History (77 AD): 'When a building is about to fall down, all the mice desert it'.
It also appears in a form closer to the modern usage in Shakespeare's The Tempest, Act I, Scene II (1610):
Prospero: In few, they hurried us aboard a bark,
Bore us some leagues to sea; where they prepar'd
A rotten carcass of a boat, not rigg'd,
Nor tackle, sail, nor mast; the very rats
Instinctively had quit it.
Maybe coward, depending on the details.
"Fair weather sailor" - even fits your 'jump ship' metaphor.
- fair-weather sailor
See fair-weather friend.
Someone who is agreeable only when the prevailing conditions are pleasant.
Unreliable when the going gets rough.
Thomas Paine called them summer soldiers and sunshine patriots.
"These are the times that try men's souls: The summer soldier and the sunshine patriot will, in this crisis, shrink from the service of his country; but he that stands it now, deserves the love and thanks of man and woman."
~ Abandoner ~ deserter ~ betrayer ~ turncoat
If you don't mind using a verbal phrase instead of a noun, you could use wimp out, bail out, or punch out. NOAD says:
wimp out: withdraw from a course of action or a stated position in a way that is seen as feeble or cowardly.
bail out: (of a member of an aircrew) make an emergency parachute descent from an aircraft; eject.
• figurative become free of an obligation or commitment; discontinue an activity: she felt ready to bail out of the corporate rat race
As for punch out, NOAD says:
punch out: register one's departure from work, esp. by means of a time clock
but punch out can also be used synonymously with bail out (of an aircraft)1. So, essentially, punch out can work in two ways at once: it can mean to eject (from a flight) or to quit (from work). In some contexts, that can express the meaning you want:
Paul punched out on us; he ran to the prosecuter and copped a plea!
You might also consider wuss (or wussy). NOAD says:
wuss: a weak or ineffectual person
I've also heard the word wuss used to indicate the opposite of tough and resolute, which seems like what you're trying to convey.
1For example, “In late June another pilot was lost when he punched out after reporting unspecified problems.” (Barrett Tillman, MiG Master: The Story of the F-8 Crusader, 1980, p. 93).