Third-rail electric locomotive