The advantage is the direct transfer of mechanical power.
This is why many elevators today still use cables rather than putting a giant electric motor inside the elevator.
The only real advantage I could see over a cable car is that the piston might be much efficient over long distances or winding tracks. Kinematic bending and stretching of a cable will produce heat which will cause a reduction in efficiency whereas slow changes in pressure tend to be isothermal.
"One apparent advantage of the cable car is its relative energy efficiency. This is due to the economy of centrally located power stations, and the ability of descending cars to transfer energy to ascending cars. However, this advantage is totally negated by the relatively large energy consumption required to simply move the cable over and under the numerous guide rollers and around the many sheaves. Approximately 95% of the tractive effort in the San Francisco system is expended in simply moving the four cables at 9.5 miles per hour" https://en.wikipedia.org/wiki/Cable_car_(railway)