Some bridges and tunnels are also not electrified in Austria but electric trains still pass through them on their massive inertia alone. It's really not a big issue for trains.
It also turns out that we've repeatedly stopped and restarted our electrification campaign over the last hundred years, such that we have little persistent expertise and excessive costs per km. So it's not just tunnels and bridges.