Answer: Our question consists of several different aspects. Firstly, conducting a train on Shabbat is a grave Torah prohibition consisting of igniting a flame on Shabbat, for when one presses on the gas or electric pedal, a combustion is created; this constitutes a prohibition of Shabbat desecration similar to driving a car on Shabbat.
This transgression alone certainly prohibits such a train ride on Shabbat when the conductor or most of the passengers are Jewish. However, it would seem that there should be room for leniency when the conductor and most of the passengers are non-Jewish, which is the case regarding trains in Europe, the United States, and the like, for an additional Jewish passenger does not create any additional Shabbat desecration with regards to the combustion in the engine since the Jew’s weight is certainly vastly outnumbered by the weight of the train itself along with all its other passengers. Thus, this alone would not be sufficient to render the train ride prohibited.
Nevertheless, another prohibition does indeed exist, which is the prohibition of exiting one’s boundaries on Shabbat. This means that it is forbidden for one to leave the boundaries of the city one is currently within and enter the boundaries of another city. Since the train is passing from one city to another on Shabbat itself, riding on such a train is completely forbidden. Although one is physically not doing anything and is merely sitting in a moving train being driven by a non-Jewish conductor, nevertheless, the Ritba writes that such a thing is forbidden on Shabbat (since one has entered the moving object willingly on Erev Shabbat) and it is considered as though one is physically walking on the ground himself. Many other great Rishonim rule likewise regarding riding on a wagon steered by a non-Jew on Shabbat. Indeed, Hagaon Chatam Sofer rules likewise regarding riding on a train on Shabbat and writes that although the prohibition riding an animal on Shabbat does not apply here, for a train is not an animal and neither is there any prohibition regarding the actual riding of the train, for a non-Jewish conductor is doing all of the forbidden works on his own for the majority of the passengers who are non-Jewish, nevertheless, this is forbidden due to the prohibition of leaving one’s boundaries on Shabbat. Hagaon Rabbeinu Abdallah Somech zt”l of Baghdad, Maran zt”l, and many great other Acharonim rule likewise.
Another reason to forbid such a train ride on Shabbat is because one usually carries personal items along with him, such as money, train tickets, and the like, which is likewise another reason to completely prohibit this on Shabbat.
In the following Halacha we shall discuss the law regarding an electric train which does not cross various boundaries, such as an inner-city train or subway.