Switzerland's cable cars, funiculars and cogwheel mountain railways are, on the whole, dog-friendly, generally on the same fare and leash terms as SBB trains. Dogs must stay muzzled and leashed throughout the ride.
The one place this changes is at extreme altitude. The Jungfrau Railway, for example, applies an altitude restriction on the final stretch up to the Jungfraujoch (3,454m) for animal welfare reasons — dogs are welcome, muzzled and leashed, as far as Eigergletscher (2,320m), but not on the last section to the very top. Similar high-altitude limits can apply on other extreme routes, so it's worth checking the specific railway's policy if your plan includes the very highest stations.
Below those extreme altitudes, popular routes and viewpoints — funiculars up to city overlooks, most cogwheel lines into alpine villages — are straightforward, and a fenced or on-leash dog is a completely normal sight on board.
