After the restoration of the House of Braganza, the Second Empire of Brazil played a more low-key role in South American politics and decided to just preserve itself and by that logic, there were massive purges in both the Army and the Government of anyone having Republican sympathies.
During the Weltkrieg Brazil was at first "neutral" but helped greatly Mexico and was Pro-Central Powers, until the Ponta Delgada massacres happened, which horrified Brazil so much that they official stated their neutrality and that was it for Brazilian involvement in the Weltkrieg. In the signing of the Treaty of Berlin, Brazil was given British Guiana as compensation for helping Mexico, while Mexico got to keep French Guiana.
During the Interwar decade two things happened: 1. Empress Isabel died and was succeeded by her son, Pedro III. 2. Brazil entered a recession that brought the economy crashing down. The reason was Mexico refused to help or invest in the Brazilian economy because they were busy investing and constructing in Poland and Ireland. Unemployment raised and discontent with the monarchy grew and nostalgia for the Republic grew, while it was corrupt, at least people had jobs and the economy was stable. But the most damning thing was the Brazilian population growing hatred towards what the saw as the Brazilian monarchy being puppets to the Mexican Empire just as Portugal was.

Pedro III
In the Government, corruption had spiraled out of control with was has been named the "in out" politics with Politicians replacing one government from a different state in return for favors to another state.
In 1932, The Paulista rebellion began in July 9 with officers under Pedro Manual de Toledo leading a officers revolt with the aim of a new constitution and a end of the corruption.

Pedro Manual de Toledo
The rebellion stood no chance of triumph, the Government Army had more soldiers, aeroplanes, the Navy, and more artillery pieces. By October 2 the rebellion was put down and many assumed the soldiers would be given clemency, except that didn't happen instead what happened would be called Bloody October where over 20,000 officers were executed, including de Toledo.

the Paulista Rebellion
This caused a uproar and instead of ending the Rebellion it morphed into a civil war with Government and monarchist troops against Republicans, communists, and reformers. This also devolved into a proxy war between the Second Mexican Empire vs Argentina, with Mexico supporting the Government and Argentina supporting the rebels.
By October 1936, the rebels were nearly defeated and were now stuck in the Amazon fighting a guerilla war along with natives. This would lead to vicious reprisals on the indigenous people by the government soldiers. Because of this, it would lead to Bolivia and Peru intervening to protect Indian rights.
By 1939, the tables had turned against the Brazilian government, with Argentina, Bolivia, and Peru intervening against the monarchy and worst the Second Weltkrieg had begun and Mexico had to withdraw all support to Brazil.
By December 14, 1939, Emperor Pedro III fled to Portugal and the Second Brazilian Republic was proclaimed but was severely weakened and was little more than a Argentine Puppet.