Tickets get check randomly by ticket inspectors. It will cost you 40€ when they catch you without a ticket plus the embarrassment when the whole train notices that the tourist forgot to buy a ticket ( ;-) ) . It is not a crime unless you repeatedly didn't buy a ticket.