For safely - probably stay clear of known unsafe countries/areas. Columbia as a country comes to mind, Rio Dejanerio as a city.
There are virtually NO trains in South America. The standard for inexpensive travel is bus. They have a wide range from very cheap local (you would probably want to avoid) to still cheap, but fully air conditioned and comfortable. I have used them extensively in Brazil.