Or -hear me out- we can put these long I beams on the ground and put some cables above. Then tie 50 trucks to each other and they can get whatever kind of electricity from anything you can make electricity out of.
Add a battery car and you only have to electrify a minority of the lines to be off diesel a majority of the time.
Extra points for electrifying steep grades.