At least on a cruise, they can place the deceased in a cool place until they reach port.
I'm surprised that this many folks pass away on flights on major airlines a year.
I have heard that, at least on smaller cruises, the "cool place" is the same room where they keep all the food.