It takes both skill and courage to control huge locomotives laden with mineral ore as they wind up and down the Andes mountains - making Peru possibly the toughest country in the world to be a train driver.

The Ferrocarril Central Andino (FCCA) travels from sea level to the mines at Cerro de Pasco, one of the highest cities in any country, at 14,200ft (4,330m) above sea level.

The ascent, on some of the steepest tracks in the world, is a slow grind, but the real skill is in bringing the fully loaded locomotive back down to the Pacific coast, west of the capital Lima.

"You need to have nerves of steel," says driver Daniel Garcia Zegarra. "This is how you need to treat the train, caress it little by little, no roughness, but slowly."

Up in the mountains, the railway tracks have few signals or even safety barriers to guard against the sheer drop. The slightest error from a driver could prove disastrous.

Once the brakes failed... We ended up travelling at 130km/h

"The train would derail and go down the cliff," says Ameliano, the train's brequero, or brake man, who has the crucial role of adjusting the large mechanical brakes.

The rear wagons of the 200m-long train are often out of the driver's sight as the route zig-zags, and its weight when fully laden with trucks and cargo can approach 2,500 tons.

There is a constant fear of derailing and falling down the mountainside.

"Once the brakes failed," says Ameliano. "We ended up travelling at 130km/h. We crashed into a tunnel.

"I took cover in the second wagon and I survived. The driver died, jumping out as the train derailed."

Daniel remains constantly alert, maintaining a steady speed to avoid possible disaster.

The air is thinner at such high altitude and the engine can stall if it is running too slowly.

It is a skill that is difficult to acquire even for an experienced train driver like Simon Davies from the UK, who travelled to the Andes with the BBC film crew.

Off the beaten track The Ferrocarril Central Andino runs for 535km (332 miles)

It reaches 4800m (15,748ft) altitude at Galera station, about the same height as Mount Blanc

There are 27 stations on the line

Gradients on the line reach 5% between Matucana and Galera

The railway crosses the Altiplano - the highest plateau on earth outside Tibet - which spreads across parts of Peru, Chile, Argentina and Bolivia

Once at the controls, Simon stalls the engine and the crew try but fail to get it restarted.

The men are now at risk of being stranded in sub-zero temperatures as they await rescue, and Simon senses real concern.

"Being stuck there, with no heat, no power... They were trying to hide it a bit, but I could see a bit of panic on their faces," he says.

Eventually, the engine starts but their trouble is not over.

The wheels spin, unable to get any traction, and as the weather worsens, Daniel decides on a drastic course of action.

"We have too much weight. The snow makes it worse. We need to remove some of the wagons. We have to cut the train in half," he decides.

It is well after dark before the exhausted crew arrive at their destination.

A chastened Simon is getting a taste of just how difficult conditions are for the men trying to control these huge trains.

"There are many times you lost concentration," Daniel tells Simon over a cup of tea. "This is because you are not watching your speed.

"If you lose concentration for just one second, it can be very costly."

The Andes mountains contain some of the richest reserves of metals and minerals on earth. Copper, zinc, lead and silver are all found here.

"If there wasn't any mining here, there wouldn't be any railway. We only transport minerals," says fellow driver Eloy Galvan.

The metals and minerals account for 60% of Peru's exports and have brought new wealth to the country.

The men of the FCCA can often spend up to two weeks away from home while on shift, working every day until they reach their destinations and then spending their nights in small, unheated cabins on the mountainside.

"These are sad and lonely places. It's not like home with my wife and children," says Eloy.

"I'm usually pretty good at working hard, but this is something else," agrees Simon. "This is more than hard work."

"We have to stay over and it's freezing cold. I'm leaving my hat on. I've got all my clothes on, because it's absolutely freezing and we've only got these llama blankets."

Waking the next morning and after a prayer at a shrine to the Virgin of Cocharcas, the men prepare to take the now fully laden train back down the mountainside.

Back home at the port of Callao, the railwaymen's families face an anxious wait for the crew and their heavy load to return safely home.

"I am scared. He's told me he sometimes comes down with 2,200 tons," says Cathy, Daniel's wife.

Image caption UK passenger train driver Simon Davies was taught to drive Daniel Garcia Zegarra's freight train

"It used to be less. When he comes down with 2,450 tons I tell him: 'No, think of your family.'"

Half way down the mountainside, the wheels do overheat but Daniel is alert to the danger. A short delay is enough to let them cool down, and the 15-hour non-stop journey continues.

For Simon Davies, who normally drives for Virgin Trains between London and Manchester, it is an experience he will never forget and he is struck by what his Peruvian counterparts have to endure.

"Every day, every hour, they're working with potentially major danger to provide for their families.

"That camaraderie is there, that teamwork is there and they really look after each other. I describe them as like warrior-type drivers."

Toughest Place to be... a Train Driver is on BBC Two at 21:00 GMT on Sunday 12 February or watch online via iPlayer (UK only) at the above link.