Edited image of #401 Locomotive by Baldwin Locomotive Works, an American builder of railroad locomotives in the past.
This one was produced in 1920 and is 4-6-2 type: four-wheel leading truck, which made for stability at speed; six driving wheels, which allowed for the application of more power than the earlier 4-4-2 "Atlantic" design; and a two-wheel trailing truck, which permitted the firebox to be behind the high driving wheels, allowing it to be both wide and deep.
In the past, it transported Brazilian rural production trough NOB (Estrada de Ferro Noroeste do Brasil) railway.
Today, this is one of turistic steam locomotives from VFCJ (Viação Férrea Campinas - Jaguariúna).
This photo was taken at Anhumas Station, in Campinas, Brazil.