If you are on a train and want to connect to the internet using your laptop or tablet then your best option is to use the WiFi service provided by many train operators. This may be a free or chargeable service depending on the train operator and whether or not you are in first-class.