In Germany (and I assume also in Austria) it works like this:
The second you board a bus or train, you enter a contract with the operator.
And that contract contains that you pay a high penalty (EBE = Erhöhtes Beförderungsentgelt = Increased Transit Fare), if you have no valid ticket on you.
Fare dodgers on trains generally get caught, since there is a finely tuned grid of controls by staff.
It's also no joke to dodge fares in Germany. It's codified in the penal code (§265a StGB "Erschleichen von Leistungen" = Fraudulent Use of Services).
A considerable percentage of German prison inmates is fare dodgers that failed to pay the EBE, or that were repeated offenders.
In return we have no ticket barriers. When I go overseas it always feels so weird that transit companies have so little faith in their customers.