There are different types of rail passes. For EU pass, you can
just buy a 3-country pass (min is 3) if you plan to visit 2
countries only. Minimum 5 trips. Furthermore, if your train goes
past any other country, you are supposed to have a ticket to pass
through (pay extra), or have listed that country in your rail pass
(you got 1 free slot if you only travel 2 countries)