It's a double edged sword as the trees put leaves on the line that make it slippery and can fall on it for trains to hit. They do stabilise steep cuttings though. Something like soil nails or other erosion control measures, combined with smaller trees and bushes would be ideal however more expensive