Initially, Brazil was developing its agriculture and its economy was mostly based on it because of numerous reasons, with the most important being the geography and the climate in the country.
The mining, without having the modern equipment, was almost impossible in most of Brazil. The reason for that was that the country was in big portion covered with dense tropical rainforests, there were way to many rivers and low underground waters, and very often there were floods, which were all things that made it way to risky for exploration or engaging in the mining of some minerals.
The logical solution was to engage in agriculture, as the soil and the climate were perfect for large scale production of cash crops. Brazil used that to the maximum, and the country became one of the agricultural powerhouses in the world.