There are overhead electric rail lines supporting double stack freight in the NEC USA, China, India, and possibly elsewhere. There are YouTube videos and images on web. AAR Plate H (20’ 2”) is the North American rail loading gauge for double stack containers, so 21’-23’ for the electrical lines is enough clearance. Nothing unusual here, straight forward for new lines, but as you noted potentially a lot work/cost on existing lines to create enough clearance due to raising overpasses/structures and/or undercutting them and tunnels.