Why this is the answer
The order is fixed in No. 53.1 of the Radio Regulations. Distress communications have absolute priority over all other transmissions (No. 32.1), urgency comes before everything except distress (No. 33.7A), and safety before everything except distress and urgency (No. 33.7B). The spoken signals mark the level: MAYDAY, PAN PAN and SECURITE.
In practice priority means giving way. A station that hears a distress alert or call stops any transmission that could interfere (No. 32.4). A coast station that receives calls from several ships at the same time decides the order using the priority of the traffic each ship has on hand (M.1171, § 4).