Media playback is unsupported on your device Media caption Hydrogen trains: Are these the eco-friendly trains of the future?

Hydrogen-powered trains are arguably the greenest trains out there.

"Mini power stations on wheels", is how Alex Burrows from the University of Birmingham describes them.

He is the project director for the 'Hydroflex' train which was showcased at an event in the West Midlands.

Unlike diesel trains, hydrogen-powered trains do not emit harmful gases, instead using hydrogen and oxygen to produce electricity, water and heat.

It is "a fully green fuel", says Helen Simpson from rail rolling stock company Porterbrook, which created the Hydroflex in partnership with Birmingham University's centre for Railway Research.

But hydrogen trains are still incredibly rare.

The only two in active service in the entire world are in Germany.

Britain is looking to become one of the next countries to start running them.

And the 'Hydroflex' is a tester train where the technology is being trialled.

The hydrogen tanks, the fuel cell and the batteries sit inside a carriage where passengers would normally sit.

In future commercial models that equipment will have to be stored away above and beneath the train.

Image caption The Hydroflex tester train is the first hydrogen-powered train in the UK. It will start running tests on the UK mainline from March.

So why is this all happening now?

A quarter of the UK's trains run solely off diesel.

The government wants them all gone by 2040.

"The carbon writing is on the wall", says Mike Muldoon from French train manufacturer Alstom, the company behind Germany's hydrogen trains.

He argues the rail sector has to get greener "if we are going to convince more people to shift from car to train."

But until the day when hydrogen trains are ferrying passengers around the UK, diesel-powered trains are a necessity.

That is because more than two thirds of our rail lines do not have overhead cabling which electric trains need to run.

So trains are bi-mode, which means they can run off electricity, where there are overhead cables, and off diesel the rest of the time.

But bi-mode trains are, in environmental terms, far from perfect.

And electrifying rail lines does not come cheaply for the government.

Regional routes which carry relatively few passengers are unlikely to be electrified soon.

And that is where hydrogen trains come in.

The hope is that they will be carrying passengers in the UK in two years.

Rail electrification in numbers

In January 2018, 36% of the UK's rail network was electrified.

Because the busiest routes are electrified, 70% of all trains in the UK are electric.

24% of the UK's trains are diesel-only.

The remaining 6% of UK trains are bi-mode.

Since 2010, the government has electrified 248 miles of track.

Source: DfT

Can Britain just use the same hydrogen trains as Germany?

The short answer is no. That's because German trains are taller.

"Because the Victorians went first they built trains smaller", says Mike Muldoon from Alstom.

Smaller trains means less space to fit all the technology on board.

The challenge now is to design trains which have enough hydrogen in their tanks to last an entire day.

"The technology should be discreetly hidden", says Mike Muldoon, Alstom's UK head of business development.

For example its hydrogen trains in Germany, which are similar to a future UK train design, have the fuel cells in the roof and the batteries underneath the train.

Porterbrook's 'Hydroflex' train is bi-mode, meaning it can be powered by electricity made from hydrogen or take electricity from overhead cables.

The plan is that the train will begin testing on the UK mainline in March.

Helen Simpson, from Porterbrook, says hydrogen trains are "very practical" for replacing long-distance diesel routes."