The locomotive is the part of the train that provides the power. Typically it is located in the front and pulls the train, but sometimes it is located in the back and pushes. Larger trains may have more than one locomotive.
Trains were originally driven by steam-powered locomotives. Starting in the 1920s, these were replaced with diesel locomotives, although some examples of steam locomotives can still be found in use today. Railway lines that see high traffic have switched from diesel to electric power in modern times. An electric train receives power either from an overhead line or a ground-based third rail.
Rails are what a train runs on. These are made of metal and laid on a prepared bed to secure them in place. The wheels of the locomotive and train cars are grooved to fit the rails, allowing them to grip them. Another rail-related issue is the rail gauge, or the distance between the rails. This sometimes varies between systems, and in inefficient examples it even varies within countries, and hinders interoperability between rail networks. The standard/international gauge of 4 feet 8.5 inches is in use in only 60 percent of the world's rail systems. Major examples of non-standard gauges are the former Soviet states, India, Spain and Portugal.
Locomotives pull rail cars, which are the body of the train. There are various types of passenger cars available for a passenger train. For a commuter train, these cars will be situated with rows of seats for maximum comfortable carriage of a relatively short distance. Inter-city or long distance trains may have sleeper, lounge and dining cars as well. Freight trains will have various types of cargo-carrying cars, such as box cars, flatbed cars and tankers.
Rail cars are joined together by couplings. A coupling is also used to attach the cars at the ends of the train to the locomotive. These mechanisms are just as important for rail interoperability as the rail gauge, since incompatible couplings cannot be joined together.
Train travel varies with the country and the line, but 3 things are standards throughout the world: all trains depart and stop at stations; all trains have an estimated departure and arrival time; and all trains come with passenger classes.
Since trains travel on a fixed rail line, they have pre-determined points of departure and arrival, and possibly stops in between. An "express" is usually a train with few or no stops. Getting to where you want to go by train is a matter of finding what train stops there. Also note that large cities, especially in Europe, may have multiple train stations. A common mistake is to book a seat on a train going to a particular city, and then get out to discover you are in a suburb instead of the city itself.
Rail tickets come in a variety of classes, typically first, second and third, depending on the operator, with additional features being sleeper berths and dining and/or lounge cars. A short-distance route that services primarily commuters is not likely to have sleepers and a dining car, for example, but will probably be entirely second class or its equivalent.
Immigration law is the same regardless of whether a person enters a new country by rail, road or airplane; you either need a visa or you do not. For example, once inside the European Union, no one will look at your passport when crossing a border. If you leave and enter Russia, the basic legal requirements will be the same as if you entered by flying in or driving across.
The real differences concern how passports and visas are handled. Some border crossings require the train to stop, all passengers to disembark and pass through a passport control station. Such is the case in Malaysia-Thailand. The alternative is to do passport control on the train itself, which is not always the most pleasant option. For example, the New York-Montreal train route stops at the Canadian-U.S. border for hours to do passport control, which would be unheard of in Europe. Also, there are countries that may require a proper tourist visa (more than just the short-term tourist stamp familiar to so many) for entry, but do not grant Visa-On-Arrival at their border rail crossings. Others simply do not allow any cross-border passenger traffic whatsoever. India-Bangladesh was a good example of this until 2008.
Customs is similar to Immigration; it will either be a consideration or it will not. However, whereas all international airports have a customs station, require a customs declaration and occasionally stop random travelers for an inspection, such practices are uncommon in international passenger rail traffic. A general rule of thumb is that if you are required to leave the train for passport control, you will also need to go through a customs station. That means bring your bags (which you should anyway, so as to not leave them unattended). If there is no station requiring you to exit the train, you will probably not be bothered with a customs declaration.