British Transport Police said it had been made aware of the incidents of trespassing at the Glenfinnan Viaduct.
The force said people were walking on to the West Highland Line to photograph the viaduct, which features in the Harry Potter fantasy adventures.
The family was seen running on the railway line over the summer.
Train drivers and Network Rail staff also reported seeing two men on the line taking photographs and a group of hillwalkers "wandering casually" on the line between Glenfinnan and Arisaig.
British Transport Police (BTP) has highlighted the incidents ahead of the start of the October school holidays.
Inverness-based Constable Nicky Ritchie said: "We know that visitors, many of them foreign, want to enjoy this incredibly scenic area and are keen to see and capture the trains, particularly steam trains, crossing what is without doubt a magnificent structure.
"However, they have to realise that they need to do it safely and without breaking the law.
"We have been working closely with Network Rail to advise local people, sightseers and tourists about the dangers of trespassing and the possibility of disrupting the rail network."
The BTP officer added: "I'm grateful for the co-operation of West Coast Railways, who carry thousands of tourists to the area each year, who have now included advice on their website for anyone booking a trip on one their charter steam trains.
"The proprietors of the Glenfinnan station visitor centre are also assisting us by making sure visitors are aware of the need to stay off the tracks."
Mark Henderson, of Network Rail, said: "Trespassing is extremely dangerous and can have tragic consequences for those involved.
"Trains travelling at speed take a long time to stop and anyone struck by one is likely to be killed or very badly injured."
From Glasgow, the West Highland Line offers journeys to the west coast and Oban, or northward to Fort William and Mallaig.
It regularly features on lists of the world's greatest railway journeys.
Three years ago, a steam train driver was forced to brake on the Glenfinnan Viaduct after spotting two older women standing dangerously close to the line.
The driver also reported narrowly missing a man who had been standing on the railway with a camera tripod in the same incident.
A couple and child have been among people seen putting their lives at risk on a Scottish railway line made world famous by the Harry Potter films.