Desperate times call for desperate measures, and if you really have to use a toilet on the Dutch railway system, the answer may lie in using a plastic bag.

Dutch Railways (NS) says it is making special plastic bags available on short-distance trains for people who really need to go to the washroom, according to the Dutch daily newspaper the Telegraaf.

Train passengers can ask the driver for a bag that is easy to close and made of degradable plastic, and then go into the driver's cab to do their thing.

Dutch Railways says the bags will only be given to people who cannot wait until the next station to use a toilet, says the newspaper.

The plastic bags are the answer to long-standing complaints by passengers and railway staff that have made their way to parliament. One train driver crossed the railway platform to get to another train with a toilet, but it left with him still on board, leaving his passengers in the other train stranded.

Last year, parliament agreed all trains should have toilets, for reasons including that short-distance trains are sometimes used on long-distance lines.

However, in April, Transport Minister Melanie Schultz van Haegen said adding toilets to the 131 trains would be too expensive. One report said the move might amount to the equivalent of more than $125 million.

The Dutch Rail Passengers' Association (ROVER) says it is pleased with the plastic-bag solution, but is still pushing for onboard toilets.