Freighthopping

Freighthopping or trainhopping is the act of surreptitiously boarding and riding a freight railroad car, which is usually illegal. In the United States, this became a common means of transportation following the American Civil War as the railroads began pushing westward, especially among migrant workers who became known as "hobos." It continued to be widely used by those unable to afford other transportation, especially during times of widespread economic dislocation such as the Great Depression. For a variety of reasons the practice is less common today, although a community of freight-train riders still exists.
Technique.
Typically, riders will go to a rail yard where the trains switch out crew. They will either know from other riders of a spot to hide and wait, or they will find one themselves. Depending on the size and layout of the yard, riders may have to get on the train while it is moving; doing this is known as "catching on the fly."
Safety concerns.
Freight train cars are not designed for human riders; hopping on (or off) moving trains bears serious risk of dismemberment or death. In March 1899, Welsh "tramp-poet" W. H. Davies lost the lower part of his right leg after jumping a train at Renfrew, Ontario. The incident is recounted in his 1908 book "The Autobiography of a Super-Tramp".
The 1944 Balvano train disaster involved (and was partially caused by) hundreds of freighthoppers. YouTube user hobestobe, aka Stobe the Hobo, was sadly killed while freighthopping when he got snagged on a passing Amtrak train.
Riding the rods.
In the 1900 to 1920 days of wood frame freight car construction, steel truss rods were used to support the underside of the car in order to provide it with the strength to carry heavy loads. There could be four or more of these truss rods under the car floor running the length of the car, and hobos would "Ride the Rods." Some would carry a board to place across the rods to lie on. Others would lie on just one rod and hold on tightly. Riding the rods was very dangerous. When a train moved at high speed, the cars could bounce and rock violently if the track was rough, and rock ballast might be tossed up which could strike a rider.
Modern day hopping.
Hopping trains happens all over the world and varies from place to place. Some places are more critical and consider freight hopping a crime, and other places are more lenient.
United States.
Union Pacific Railroad in the United States encourages people who witness transients on freight trains to report them to its dispatch center. According to a sheriff's deputy from Lincoln County, Nebraska train hoppers no longer write symbols on trees and buildings, but there is still a network of train hoppers that occurs mostly online.
Mexico.
It is estimated that yearly between 400,000 and 500,000 migrants, the majority of whom are from El Salvador, Guatemala, and Honduras, hop freight trains in the effort to reach the United States.
Mauritania.
In the Mauritania Railway, freighthoppers can ride with their cargo freely due to the lack of road between Zouérat and Nouadhibou