KiwiRail reminded people they were trespassing if they crossed or walked along railway tracks at any place other than a designated level crossing. Trespassing is illegal under the Railways Act 2005.
KiwiRail general manager of Metro David Shepherd condemned the actions of the men. "Trespassing on the rail corridor is a huge problem and people who do this, whether it's being on the rail corridor or riding on the back of a train, run the risk of not only killing themselves but also traumatising the people who then have to deal with the consequences of their actions.
"There is no doubt in my mind that those two young men could have been killed or very seriously injured with long lasting consequences for their families, emergency services and Tranz Metro staff.
"We will be doing everything we can to help police identify these two young men and strongly urge anybody considering trespassing on the rail corridor to think about the value of their life and how their families will feel if they are killed or injured."
Last year there were 418 reported incidents of trespassing on the rail corridor nationwide, an increase of 103 on 2013.
Megan Drayton, manager of TrackSAFE NZ, a charitable trust which raises awareness about rail safety, said trains could be deceptively quiet and it was easy not to realise a train was approaching which is why trespassing was taken so seriously.
"People need to realise that the rail corridor is dangerous and the outcome of being struck by a train is usually fatal.
"The only legal place to cross a track is at a level crossing. Trespassers run the risk of a criminal conviction including the prospect a large fine. People need to seriously consider whether it is really worth it."