During the Holocaust, the main method used by the Germans to transport Jews from various conquered countries to the death camps was the railroad. Trains were used to move the Jews to the death camps. It should be noted that these were not nice passenger cars with seats and everything. Instead, the Jews were typically crammed into cattle cars with the doors sealed shut. Conditions were terrible in the cars and caused great suffering for the people being transported.
There were cases in which trucks were used or Jews were made to walk, but the majority of transport was by rail and railroads were built to the camps to facilitate this.
Most of the time trains and railroads were used to transport people, and most of the time, people thought they were off to work, not off to their deaths.