Today, a lack of passengers and improved highways may kill off the Hijaz line once and for all, a quiet demise for a train that entered popular imagination, thanks to Lawrence's war exploits later turned into the classic film Lawrence of Arabia.
On one recent morning, only four passengers climbed on board for the Amman-Damascus trip through Jordan's ochre deserts and Syria's fertile plains, the railway's only surviving service.
The 175km journey takes two and a half hours by car, but on the Hijaz line it can last anywhere from seven to 10, depending on seemingly endless delays at local stations and emergency stops to remove goats and vagrants from the tracks.
Built by the Ottoman sultan during the golden era of railways in the 1900s, the Hijaz line ran for 1300km from Damascus to Madina, ferrying pilgrims to Islam's sacred sites and troops to rebellious Arab provinces under Ottoman rule.
The fabled railway has few thrills these days. Fine grit blows steadily in through cracked carriage windows, the upholstery is shredded and swarms of flies attack lunches. The toilet is a hole in a narrow carriage.
But the ride also offers colourful scenes of desert life as the train clatters along at 40km an hour.
Beduin herd goats and sheep grazing in arid hills.
Bedouin children waving at
passengers is a common sight
Children run out of tents pitched along tracks and wave at passengers.
In Syria's Hauran region, the desert gives way to gold-coloured fields of wheat. Melon plantations thrive next to villages, where mosque minarets and bell-towers of Orthodox churches rise over rooftops.
During its heyday, the Hijaz line ferried thousands of pilgrims every year. Today, it draws mostly locals and some foreign train buffs and curiosity seekers.
Along the route, lie relics of the line. Rusty German and Belgian-made steam locomotives sit abandoned in yards. Water towers stand in Ottoman-style stations, where station-masters ring bells to announce the train's departure.
"People used to travel on the train, but after cars and highways came passengers disappeared," said Abu Zabdi, a 79-year-old mechanic who has worked on the Hijaz line for 40 years.
At every stop, Abu Zabdi, who said he knows every coach like each of his eight children, jumps off the train to inspect wheels, axles and hooks.
"Some of these carriages are 100 years old but they run like the first day," he said proudly.
In Zarqa, a gritty industrial city north of Amman, the train made an emergency stop for a vagrant sleeping on the tracks. The man, apparently drunk, was handcuffed and brought on board by police officers.
Near the Syrian border, a group of schoolchildren accompanied by women in black veils crowded one coach. The hot air filled with the smell of pita bread from their lunch boxes.
A Palestinian refugee camp
greets one's arrival in Damascus
Two conductors offered small, clinking porcelain cups filled with bitter dark coffee.
"I'm going to Damascus to see family. Cars are faster but here I enjoy the views," said a middle-aged passenger standing on the outer rail as the diesel engine lumbered into the city of Deraa, in Syria.
In his Seven Pillars of Wisdom, Lawrence describes Arab troops entering liberated Damascus, where "the silent gardens stood blurred green with river mist, in whose setting shimmered the city, beautiful as ever, like a pearl in the morning sun".
The traveller who arrives on the outskirts of modern-day Syria's capital on board the Hijaz line sees a squalid and noisy Palestinian refugee camp and a rubbish dump that runs for miles.
The construction of the Hijaz line was a major engineering project.
About 6000 Turkish soldiers, mostly conscripts, laboured on the railway, braving hostile tribes, cholera outbreaks and sandy terrain prone to violent winter floods.
The line opened in 1908, spelling the end of the old camel caravan, in which pilgrims rode for two months from Damascus to Madina, compared to three days on the train, which had luxury cars for the sultan and his entourage.
"The train has been my bread for years. The Hijaz is my home"
Train mechanic Abu Zabdi
The military use of the line by Turkey, allied with Germany during the first world war, brought the demise of the railway.
Arab fighters struggling for independence led by Lawrence, an enigmatic British intelligence officer, launched demolition raids against the Hijaz line.
Jordan, struggling to boost tourist revenues, has tried to revive the line with Lawrence-themed tourist packages, but the long hours make the trip unpalatable even to backpackers. The region's turbulence also scares away visitors, officials say.
The Amman-Damascus service has been cut to twice a week from four times a week due to poor demand.
Abu Zabdi said he did not know how much longer the line would run but that he would work until his last day.
"The train has been my bread for years. The Hijaz is my home."