Railway system is quite similar in Europe so I will use Db as an example.

ICE (Inter-city express)

more comfortable seats and wifi onboard
ICE, (Inter-city express), IC, RE, S-bahn are the rail service of DB mainly. ICE is the most expensive one while S-bahn is the cheapest.
You can buy tickets by 3 ways
1. machine
accept cash/cards

2. DB counter
accept cash/cards but have to queue up
3. DB application
accept Sofort/credit card or paypal only but quite convenient and user-friendly
https://www.bahn.com/en/view/index.shtml
If you want to travel without ticket, it is possible to do so if you take RE or S-bahn, they won't check your tickets for every single stop. Something it do happened for ICE also, you could try if you travel for non-peak hours and 1-2 stations only.