The batteries are supposed to eliminate the need for 100% coverage, though, isn't it?
This would be so much simpler than electrifying the whole line and much easier to maintain.
This infrastructure is often already at key stations, and so it might require no extra work to implement them. Just more money for the battery powered trains.
edit: also I don't think your idea will 100% work because it would take some time to charge the trains at the stations.