I came in the train
Some transport uses ‘in’. Some transport uses ‘on’.
The rule for this is not whether you can go inside the vehicle.
The rule is:
services use ‘on’
independent or special transport uses ‘in’
(An easy way to think about this is: does the transport usually do this journey, even when I am not here? If it does, it probably uses ‘on’.)
in the taxi
on the train
in the boat (if a private boat)
on the boat (if a ferry or service)
in the plane (if a private plane)
on the plane (a normal plane)
Bicycles use ‘on’.