The Trieste-Opicina hybrid tramway employs standard electric trams on the level areas, but in order to climb and descend the hill route, the drivers pull up to a cable grasping tractor in a siding and proceed from there. The tractors are not linked to the trams at all, they are remote controlled by the drivers from inside the tram, and freely push the trams up the hill and gravity brake them coming down.
Clever engineering.
https://www.youtube.com/watch?v=bM80S7JNqAw