(ofc the trouble is how to handle the next train coming in 15 minutes)
OTOH there are such a thing as 'fireless locomotives' which just load up on steam pressure from a stationary boiler and then operate for some miles without need for fuel or any exhaust more noxious than water vapor. But this scheme didn't come for some decades after 1861. I wonder if a cable car would have been feasible.
I would think no reasonably usable cable of that total length would work. But what if you could break it up into segments, with a car releasing the cable of one segment and coasting to grasp the cable of the next segment, and some other system (possibly massively thick cables, possibly some mechanism) underlying it and supplying power to the smaller loops.