To give you some examples of what was done, on Olympic's eastbound (return) leg of an August 1911 voyage, a second-cabin passenger died in the ship's infirmary and was later buried at sea. In May 1913, another second-cabin passenger died and was buried at sea after the passengers had been retired for the night, even though Olympic was less than 2 days out from New York. In March-April 1914, 6 people (2 crew, 4 passengers) died aboard Olympic. I believe all were buried at sea.
The decision is sometimes tricky...in December 1921, a first-cabin passenger gave birth to a still-born baby in the infirmary, just before the ship pulled into New York. Was the baby buried at sea, or taken off the ship at Quarantine? I don't have a record of the decision that Captain Hayes had to make.
Britannic had a morgue back aft, but she was configured as a hospital ship. I imagine that in Olympic, bodies were kept on ice in the refrigeration hold until such time as the remains could be disposed of.
It's an interesting question that you raise. Deaths at sea are recorded in the ship's log...the examples I quoted above came from Olympic log extracts which Simon Mills included in his history of Olympic. Neither Titanic's surgeon nor the ship's log survived, so it's conceivable, but highly unlikely, that someone died in Titanic before the collision. It leaves a tiny opening, though, that some novelist might exploit for a yarn.
There actually was a death on board Carpathia- on the return. I remember reading somewhere that the body was kept on ice. I believe, and I will look again, that the death was a Carpathia crewman- not Titanic passenger.
Don't forget the death aboard Olympic on the Westbound voyage, on April 10, 1912. It may be that since the death was in the morning and only at most half a day away from docking in New York, the body was kept, and taken ashore. The fact that he was a first class passenger may also have contributed to it. Another factor may have been that this passenger (a gambler) was traveling under an assumed name B. J. Harvey, which had a very similar sounding to the name of the son of the wealthy family. The ship's doctor even presumed that the man was that son, even dispatching a note to the family, notifying them of the death.
This information comes from George Behe's 1982 "Fate Deals a Hand" article. I also have a copy of Olympic's Southampton departure list that shows B. J. Harvey was on the Olympic, along with 9 other gamblers.
I think someone already has exploited that particular idea for a 'yarn' - in "The Titanic Murders" the bodies of the victims murdered before the collision are sealed up in bags and kept in the 'cold storage hold'. Their gruesome discovery by one of the salvage expeditions is described.
Deaths aboard ship were quite common - not a few of them were suicides. The notes in the Official Logs investigating these occurances are sometimes quite extensive. One, dealing with the suicide of a stewardess on the Oceanic who jumped overboard while suffering from depression after seperating from her alcoholic and abusive husband, was terribly poignant. The story unfolded through the statements of two women passengers she had attended during the voyage and to whom she related her depression and its causes. It was they who first raised the alarm when she went missing - no note was found, just her hat sitting on the deck.
In another case a passenger sent his cabin mate for the ship's doctor - by the time they had returned he'd put a revolver to his head and pulled the trigger. Most, however, seem to have preferred jumping over the side. In one memorable incident (Oceanic as well, from memory) the cry of 'man overboard' went up. The ship was stopped, the emergency cutter prepared for lowering - only to find that the man was clinging to a portal.
Lol - yah, that was one of little yarns. Wish I'd had the time to go through and collate all the deaths on record that I looked at.
On a more cheerful note, some of the reprimands to drunken crewman contain entertaining snippets of dialogue recorded ('I'm through with the White Star Line!' etc etc). Need to track down again and copy the one that referred to a man who went on to serve on the Titanic.