The sky turns from indigo to ebony as the tropical night falls, and the train patiently thrusts through the jungle towards its destination, still hundreds of kilometres (miles) away.
The trek has the hallmarks of one of the world's Great Forgotten Train Journeys -- a voyage through 648 kilometres (just over 400 miles) of lush equatorial forest.
The train is the brainchild of Gabon's former president, Omar Bongo, who ruled for 42 years until his death in 2009.
In the 1970s, he dreamed of linking the central African state's resource-rich interior to the Atlantic coast -- and he saw it through, despite being rebuffed by the World Bank, which refused to fund it on the grounds that it was not economically viable.
Today, the "Bongo Train", as it is affectionately known, remains the country's sole railway line, linking 23 stations from the coastal capital Libreville to distant Franceville, the country's third most populous city.
"The Transgabonais binds Gabonese society," declares Christian Antchouet Roux, the stationmaster at Franceville.
About 320,000 people take the train every year, a sign of its affordability for the average Gabonese.
Ticket prices depend on the time of year and class -- the train has a VIP carriage, as well as first and second classes.
Passengers travel only at nighttime but in air-conditioned comfort -- a rarity in the world's poorest continent -- and the blue and yellow compartments are modern.
One of them is Miyha Koumba, a young student in Libreville who uses it to visit her family at the other end of the line.
"I take the train at least four times a year. I can visit my parents regularly," she said, arriving in Libreville at 7:00 am bleary-eyed, having departed Franceville at 5:30 pm the day before.
During the day, the train hauls manganese -- a key export after oil -- from the interior to the oceanside capital.
Critics and champions
Touting the train as a symbol of national unity and modernisation, Bongo doggedly pressed on with the plan, saying: "If we need to have a pact with the Devil, we'll do that."
Fortune smiled on Gabon's leader in 1973 when the OPEC cartel of oil producing nations raised prices dramatically, filling the country's coffers and enabling him to start construction with the additional help of Western aid, notably from former colonial ruler France.
Bongo flagged off the project -- the largest in Africa at the time -- on December 30, 1973.
It cost $1.65 billion (more than 1.5 billion euros), and millions of trees were felled to cut the swathe through the jungle for the track, which is unelectrified.
In 1986, the last stretch was inaugurated in the presence of then French prime minister Jacques Chirac.
Critics of the project have long pointed to its cost, to its use as a political tool for Bongo, whose partisan stronghold was centred in the region where Franceville is located, and to French involvement.
"Since its creation, the Transgabonais has been closely linked to France and its interests," US law professor Douglas Yates, author of "The Rentier State in Africa: Oil Rent Dependency & Neocolonialism in the Republic of Gabon", told AFP.
Its champions view it as a critical piece of infrastructure for Gabon's development.
There is a road running parallel to the tracks. But it is riddled with potholes, making the journey much longer, far less comfortable, and dangerous too.
Derailments and elephants
In a country which has been grappling with the effects of falling oil prices since 2014, the importance of manganese for the economy has ballooned.
"Without manganese, this train could not exist," said Gabonese economist Mays Mouissi.
According to an economic report by the Gabonese government, the ore accounts for a fourth of non-oil exports.
Although still volatile, a recent surge in manganese prices over the last couple of years has boosted the country's oil-dependent economy.
French mining group Eramet, which extracts 80 percent of Gabon's manganese, recently said that it wants to boost production by 60 percent by 2023.
But more than 33 years after the first train started rolling, the line is facing problems.
There have been many derailments on a stretch built on unstable terrain and maintenance has been poor.
Train services have been further compromised by technical problems, while elephants wandering over the tracks have caused delays.
To keep the line going, a massive eight-year revamp was launched in 2015, costing an estimated 330 million euros.
More than half of the total will be financed by France together with, ironically, the World Bank.