I've been giving this more thought lately but I'm a little divided on how to handle it, whether to add those mechanics alongside the existing ones or to split it out into a separate mod entirely that doesn't keep obsolete/redundant features like batteries. I don't like the idea of using electrified rails personally as it very quickly becomes a means to distribute power around instead of using the power lines, and I don't care for that. If it becomes a question of mapping power from separate grids only into the rails, that opens up further questions about implementation and balancing draws and so on.
I think the better option would be to have to 'electrify' the railway by coverage from the power poles that already exist in the game and track whether the train is within the pole's coverage. As it stands (and I've been thinking about changing this too) the train has to be on a schedule and stopped at a station for the EEI that represents its internal storage to be spawned and draw power from a grid. That method works pretty well and the mod is the most popular one on the portal that isn't part of a huge integrated revamp so it seems a lot of people agree. So then the scripting side of things becomes a matter of keeping the EEI paired to the locomotive within the same network as the locomotive's current physical position. That should be doable, it's just a question of how performant it is.
Or you could try out another mod like Realistic Electric Trains and see if you prefer that, I dunno. It might be good, I haven't tried it yet because I've been on a minimal mod SA playthrough for a while.