It follows The Scotsman’s revelation that the body of a man was loaded onto a passenger service near Dumfries in January.
The Rail, Maritime and Transport union (RMT) and the main drivers’ union Aslef, jointly called on ScotRail to cease the practice.
They raised concerns with the train operator at a meeting today after the driver and conductor of the late-night train complained.
The main who died had been hit by another train in an apparent suicide.
Aslef Scotland secretary Kevin Lindsay said: “Today RMT and Aslef both told ScotRail that no train should be used to carry bodies after they’ve been involved in a railway fatality.
“I made it clear this incident was totally unacceptable that the driver and conductor were put in a position where they had to work a train with a fatality on board.
“Neither union can find any evidence that this has ever happened before.”
RMT Scotland organiser Mick Hogg said: “Under no circumstances would either union agree for the transportation of a body in a body bag after a fatality on a passenger train.
“If circumstances were ever to arise again we would instruct our members not to work the train on the ground of health and safety.”
In the incident shortly before midnight on Sunday 19 January, the body of the man was put on the train by police and ambulance staff about one mile north of Dumfries.
The six passengers on the Glasgow-Carlisle service were moved to another carriage.
It is understood the decision was taken because of the distance to the nearest road.
The emergency service workers are thought to have had to walk about a mile along the tracks to reach the body.
It was taken off the train at Dumfries Station.
British Transport Police said: “Occasionally, when deaths happen in particularly rural areas where there are long distances to the nearest road, trains may be used to transport a deceased person into the care of the procurator fiscal.
"In these cases, permission will be sought from the train operating company and the deceased will be accompanied by BTP officers.
"To ensure their dignity, they will always travel in a separate and private area to any other passengers.”
ScotRail declined to comment on the unions' demand.
A spokesperson said it had agreed to the Dumfries operation so "this tragic event was handled in the most dignified way possible”.