Scandalous John is a 1971 film directed by Robert Butler. It stars Brian Keith and Alfonso Arau. The music was scored by Rod McKuen.
According to Filmfacts, portions of the picture were shot on location at the White Sands National Monument in New Mexico. Studio publicity adds that the ranch used in the film was the Oliver M. Lee Ranch near Alamogordo, NM, and that Alamogordo and the nearby city of Las Cruces were also location sites. The Warbag scenes were shot at Arizonas Old Tucson Studio, which was constructed in 1939 and served as the location site for more than sixty film and television Westerns, according to studio publicity and a January 1971 Beverly Hills Independent article. The runaway train sequences were filmed in South Dakota, along the Black Hills Central Railroad line between Hill City and Keystone.
Source: Wikipedia