Cog railways were built to tackle steepish gradients as the friction on adhesion railways did not suffice for traction and the braking effect was not guaranteed on downhill runs. There is a great tradition of cog railways in Switzerland but there are also some left in Austria, usually running on electricity today.
