OK, so let that POD is earlyer, so Brazil banns importation of slaves in about 1830. And after that allows and encourages immigration of Europeans ( Italians, Irish, Germans.... ).
Encourages industrialisation as soon as possible.
Would that save the Empire?

Brazil encouraged the immigration of europeans from 1808 onwards, and they mostly settled in southern brazil were there wasn't a slave economy so ending slavery won't do jack shit to increase the rate of their arrival. Plus Brazil got lots of immigrants relative to their population already.
Industrialising is just so
easy it was silly of Brazil not to do it early in the OTL right?

Brazil lacked energy resources, until electrification and hydropower took off it was hard for brazil to make anything, and so agricultural exports were the natural result. Plus brazil produces a number of unique products that make so much money you have little left over for other capitalisations.
To improve brazil's 20th century standing you need:
* Making the US a much less attractive/welcoming for immigrants. People wanted to go to Brazil, they just wanted to go to the US
more.
* Earlier development of hydroelectricity and the whole third industrial revolution (though this will have enormous butterflies)
* No Great Depression, which wiped out all of Brazils wealth before they had a chance to try export subsitution.