The pictures include portraits of nurses who cared for the many workers injured during the project between 1897 and 1901.
They were discovered in a collection of negatives at an auction in Cornwall in 2017 and are thought to have been taken by Thomas Malcolm McAlpine, a son of line builder Robert MacAlpine.
He was badly hurt while supervising a rock blasting operation during the construction work.
The documentary, Ceol na Loidhne (Song of the Track), to be broadcast at 9pm on Thursday, sees Glenfinnan-based musician Ingrid Henderson following the story of the photographs while composing an album in tribute to the railway builders.
It features the Glenfinnan viaduct, which attracts thousands of visitors a year because of its role in the Harry Potter film on the Hogwarts Express’s route to Hogwarts School of Witchcraft and Wizardry.
The line, which extended the Glasgow-Fort William route to the fishing port of Mallaig, helped pioneer the use of concrete on a large scale, including for the viaduct and five others on the route.
Producer Annie Cheape, of Sgeul Media, said of the photographs: “Along with construction, they document the people working on the railway, and the dangerous conditions they encountered.
“These images reveal the faces of the nurses who tended the injured in makeshift field hospitals.
"They are smiling, look relaxed, happy and enjoying themselves.
"It’s unusual to see women of this period photographed in this informal way.”
"Many hundreds [of workers] were injured while blasting through the rocks, most of them navvies from Ireland or the Scottish islands.”
The death toll is unknown but could run into hundreds, from blasting, crushing, falling and drowning incidents as well as from disease and hypothermia.
Ms Cheape said: “Many men were injured during the rock blasting, but alcohol was a huge problem too.
"Men died of hypothermia after drinking too much, or had accidents on Monday morning while still under the influence.
The photographs were published last month in a book, Building the Mallaig Railway – a photographer’s story, by Glenfinnan Station Museum curator Hege Hernaes.