It happened Wednesday morning near Highway 99 and Avenue 80 in Teviston.
The train was scheduled to make a stop at J Street and Cartmill in Tulare. Law enforcement officers from several agencies found the two men on the train.
They arrested 43-year-old Travis Harris of Long Beach and 30-year-old Pedro Gonzalez of Bakersfield.
Investigators say multiple UPS packages were opened and thrown along the railroad tracks during the train route.