Fencing is being put up at a railway line known as a hot spot for trespassers and fly-tippers. Network Rail is spending �60,000 on more than 400m of fencing at Ore, East Sussex, where there have been 25 reports of railway crime in 12 months.
The 8ft fence is designed to deter people from using the track as a short cut and dumping rubbish illegally.
The firm has joined Hastings council, British Transport Police and Orbit Housing Association for the scheme.
As well as the fence, deterrent signs have been put up to highlight the dangers of railway crime.
Councillor Godfrey Daniel, from Hastings Borough Council, said: "Obviously this has become a real problem and we are concerned not only with the rubbish, but with people getting on the railway line."
Sue Greetham, from Network Rail, said: "Trespassing on the railway endangers lives.
"Passengers, railway staff and the trespassers are all in danger of injury or even death."
The fence will be put up between Ore station and Ore tunnel.
About �10,000 is also being spent clearing up rubbish which has built up near Deepdene Gardens.
Both fly-tipping and trespass on railway lines are illegal and offenders could face a fine of up to �20,000 and a possible jail term.