The second officer of the Titanic stayed onboard until the end and was trapped underwater until a boiler explosion set him free. Later, he volunteered in WW2 and helped evacuate over 127 men from Dunkirk

Charles Herbert Lightoller, (30 March 1874 – 8 December 1952) was the second officer on board the RMS Titanic and a decorated Royal Navy officer. He was the most senior member of the crew to survive the Titanic disaster.

As the officer in charge of loading passengers into lifeboats on the port side, Lightoller strictly enforced the “women and children first” protocol, not allowing any male passengers to board the lifeboats unless they were needed as auxiliary seamen.
Lightoller stayed until the last, was sucked against a grate and held under water, but then was blown from the grate by a rush of warm air as a boiler exploded. He found refuge on an upturned collapsible boat with 30 others, showing his fellow survivors how to shift their weight to avoid being swamped, until their rescue at dawn.

Later, in retirement, he further distinguished himself in World War II, by providing and sailing as a volunteer on one of the “little ships” that played a part in the Dunkirk evacuation. Rather than allow his small motor yacht to be requisitioned by the Admiralty for military service, he sailed the vessel to France and back with a small crew, and repatriated 127 British servicemen.