Travel bloggers Sukanya Chatawitt and Joana Marie Gangan posted Instagram reels yesterday and last week of themselves on train tracks at Port Chalmers.
The reels featured shots of them sightseeing around Dunedin, visiting landmarks like the University of Otago Clocktower and the Lan Yuan Dunedin Chinese Gardens.
However, Ms Gangan could be seen walking on the tracks outside a rail tunnel and on the tracks near Church St in Port Chalmers.
KiwiRail chief zero harm officer Alastair Cumming said trespassing in the rail corridor to take photos or videos on train tracks was both unsafe and illegal.
He said trespassers being struck by trains was a leading cause of public railway deaths in New Zealand and around the world.
"Trains are often travelling faster than they appear to be.
Mr Cumming said people needed to be aware that trains did not all run to schedule and could travel at any time, from either direction, during the day or night.
He said the toll of rail accidents was immense on victims, families and rail staff.
The Otago Daily Times approached the two bloggers for comment but did not receive a reply.