Brazil is very difficult country to do business in. Issues with both labor and the government. Companies were willing to make the effort when sales were booming during the 1st half of the decade but the market still hasn't recovered from the 2015 recession.
Some more info on why the Ford plant closed:
From:
https://www.automotivelogistics.medi.../38290.article
In mid-February, Ford announced that it would shut its giant plant in São Bernardo do Campo, in São Paulo state, which produces some 33,000 trucks and cars a year,
employing 3,000 staff in a three-day-a-week operation. The plant had been operating at just 60% of maximum capacity and 19% of its truck capacity, as a result of Ford relying more heavily on its plant in Bahia state.
There was not enough volume to justify running two plants. A plant running only 3 days a week is hemorrhaging money.