Red diesel as used on the railway USED to be a slightly lower grade than the diesel sold for cars.
These days it is exactly the same apart from the red dye added to it.
Red diesel may be lawfully used for almost any purpose, except for vehicles used on the public roads. Examples include trains, agricultural machines, boats, ships, generators, and oil burning heating.
There are a number of minor exceptions, for example a tractor used primarily on a farm may be fuelled with red diesel even when using public roads to move from one field to another.
Refrigerated trucks can use red diesel in the separate engine that powers the cooling, but like any other truck must use white diesel in the road engine.
AFAIK the rules only apply to internal combustion engine powered vehicles. So if you have an oil burning steam vehicle, red diesel may be used in it, even on public roads.
Overseas rules differ, in the UK ALL boats and ships may use red diesel, but in parts of Europe only working boats and ships may use red diesel, pleasure craft must the more costly road fuel. British boat owners visiting such places must be able to prove that any red diesel on board was purchased in the UK.
Red or railway diesel will work just fine in a diesel car, but such use is a serious criminal offence.
White or road diesel is entirely suitable for a train, but such use would be very exceptional due to the cost.