Hidden CCTV cameras have been placed around railway lines in Hertfordshire following an increase in vandalism.
Trespassing onto live lines can often prove fatal, Network Rail said.
Network Rail is to test the devices, with British Transport Police and One Railways, around Bishop's Stortford after a spate of graffiti attacks.
The covert cameras can be operated remotely to capture images of trespassers on the tracks.
The company said it hopes the scheme will deter vandals as the crimes cost the rail industry £264m every year.
Patrick Hallgate, Network Rails' Anglia route director, said: "Crime committed on the railway often results in great damage and cost to the industry as well as delays to the travelling public.
"It can also tragically result in the loss of life as trespassers fail to realise the dangers on the railway including 25,000 volts that power the overhead lines."