Outside of taxes, it is also a matter of political choices
The Swiss took the decision to develop the train as a first transport choice nationally... Even trucks transiting through Switzerland are loaded on trains.
And the result is there: They have a good network with a good service that unify the country.
That a strategy totally at the opposite of what USA and many European countries chose to do in the 90's: Close as many small train lines as possible and develop road transport.