Which was the first Latin American country to have a railway system?

Which was the first Latin American country to have a railway system?