Brides and grooms go to great lengths to get the perfect shot on their wedding day but this move has been slammed as "plain stupid".
A UK couple used train tracks in North Yorkshire for their photo shoot as a bridesmaid and groomsman joined them.
The couple – although not identified – have now embarrassingly become the face of a new campaign educating people on rail safety.
Allan Spence, of Network Rail, said while young people had got the message about trespassing, adults were not taking heed.
"Wedding photos or selfies on the track are just plain stupidity.
"We often warn families at this time of year as kids enjoy school half term holidays. But this time we are appealing to adults in particular.
"Please, make sure you know the rail safety basics and pass that knowledge on to your loved ones. Lead by example and stay off the tracks. No ifs, no buts – no tears."
British Transport Police Superintendent Alison Evans said the railway was not an appropriate or safe setting for a photographic backdrop, no matter how scenic the setting.
"Every time someone strays onto the rail network they are not only putting themselves at risk of serious, life-threatening injury, but also delaying essential journeys.
"Passenger and freight trains are still using the railway 24 hours a day, 7 days a week, providing much needed services of transporting people and goods. Please, stay off the track".
Network Rail and British Transport Police said there were 5100 trespass incidents over their summer months, with the total number of incidents recorded in September 1239 – the worst recorded for that month in the past five years.
The number of incidents across the rail network involving people aged 18 or under at key target locations has been decreasing year on year.
But overall national figures are bucking this trend and, for the first time in three years, the total number of incidents in August and September have actually increased – by 12 per cent and 17 per cent respectively – compared to the same months in 2019.
HM Chief Inspector of Railways Ian Prosser CBE said the increase was "truly worrying".
"The hidden dangers on the railway are real: each year hundreds take on the railway and lose and their actions have far-reaching and devastating consequences for their friends and family."