British Transport Police (BTP) and Network Rail said there had been several recent incidents of children playing on the railway line.
The youngsters were spotted putting themselves in danger in Port Elphinstone, Inverurie and Boat of Kintore in North Aberdeenshire.
A new campaign, You v Train, is warning children of 125mph trains, overhead lines carrying 25,000 volts and the hidden third rail which can pull trespassers in and “not let go until the emergency services are able to switch the power off”.
Electricity on the tracks is always switched on and nine out of 10 people die when they are struck by it, the campaign says.
BTP Inspector Bryan O’Neill said: “The railway is full of hidden dangers. Too many times we have seen the tragic consequences of young people ignoring the warnings about trespassing on the railway and taking risks that have resulted in terrible injuries or death, so it’s vital that parents play their part and ensure they know where their children are and what they are up to.
“Passengers continue to be our eyes and ears and they can help us by reporting crimes and concerns by texting 61016.”
Mark Henderson, Network Rail senior community engagement manager, said: “Trespassing on the railway can result in life-changing or even fatal injuries.
“We work closely with the British Transport Police to educate young people about the dangers on the railway and would urge the public to keep well off the tracks.”
In December, Network Rail was fined £135,000 after admitting health and safety breaches that led to a 13-year-old boy suffering serious injuries.
The teenager was hurt after he had gained access to a railway track and climbed onto the roof of a stationary train near Musselburgh, East Lothian.
The boy and two friends had managed to reach the track after climbing over fencing that was subsequently found to be "of an inappropriate type, of insufficient height and poorly maintained".
Following the incident an investigation was launched by rail regulator Office of Rail and Road (ORR) which found the fencing to be faulty and members of the public able to access the track with "relative ease".