Overhead powerlines work for a lot of rail, diesel-electric is a reasonable compromise I see used here, runs on overhead electric when it can, diesel otherwise. You can electrify the lines with the worst air quality first without having to electrify 100% of the network.
As for batteries, interesting idea, I wonder how far you would get with a fairly short range battery, or essentially turning the current diesel-electrics into plug-in hybrids. Helps that trains are pretty energy efficient too.