The Brazilian monarchy was pretty popular even when it was overthrown actually. Sure there were republicans, but the emperor still enjoyed widespread support. Essentially a small clique in the military, backed by coffee barons angry at him and his daughter over the abolition of slavery, launched a palace coup and Pedro II didn’t want to fight it (if he had, they almost certainly would have failed).
This is just a simplified narrative widespread in pop history circles that try to portray the fall of the monarchy as an accident of history, the monarchy itself as an ever successful regime, and the empire of brazil as a 'first world nation' well on the way to reaching 'developed status'. As such it hangs on a half-truth: that the 'monarchy' was popular. Pedro II was definitely popular and so was his family, perhaps with the sole exception of his son in law. But the Monarchy with a capital M, the system of government in itself spent the last 10 years of its life losing hearts and minds amongst the general population, either due to it's inability to act on political demands, the inefficiency of its public services, or due to the propaganda campaign of the Republican Movement.
The government wasn't brought down by a 'small clique' in the military and the aristocracy either. The army officialdom was united in it's utter contempt for the aristocracy. The older half of them, the ones that had reached positions of proeminence under the old(er) system of nepotism and patronage - represented by Marshal Deodoro da Fonseca - were only held back due to sentimental ties to the superior officers who patronized their rise but were still constantly up in arms by how the Court never really trusted the Army. It gets worse among younger officers, who at climbed the ranks after the modernization of the army and add to this matter of 'honor' their utter contempt for the aristocracy, the do nothing political elite, and their concerns on how to defend an enormous sparsely populated territory as that of Brazil's without true economic industrialization. This does not even include the spread of positivist ideology among the ranks. Hell, the Brazilian Navy, seen at the time as a bastion of the Monarchy, never mobilized in defence of the Monarchy itself, they only mobilized during the early republican period
in defense of the republican constitution.
The Aristocracy that brought down the Empire was not a small clique either. The landlords of the Empire of Brazil were never truly happy with the centralizing regime of the Monarchy. They only came around to it in the 1830s and 1840s (very basically) because they came to understand that every time a local group of grandees tries to oppose the government in Rio they are either eventually squashed due to lack of popular support, or they call upon the peasants to rise up only to threaten the structures that support the aristocracy itself. The aristocrats don't like paying taxes to Rio. They don't like when Rio's tax and tariff policies hurt their interests to the benefit of those who live in the Court itself. They are mostly forced to cooperate due to a common interest in pacifying the country after the 1830s Regency and to preserve both the general pattern of land-ownership in Brazil, favoring old families with large estates, and, especially, Slavery. By the 1880s the Aristocracy in the provinces are already screaming their lungs out demanding a Federalization of the central government. Periodicals would often claim that either the Monarchy became a federation or the Federation would destroy the Monarchy. Like with the Navy, when the Aristocracy of the provinces heard that the Court had fallen and the Republic had been proclaimed, their priority was not to defend the government or the Emperor. Their response then would be either enthusiastic or ambivalent. What they did afterward was navigate the following years of turmoil to ensure that the Brazilian Republic was one to their liking. The Abolition of Slavery was just the straw the broke the camel's back: the only section of the landowning class that was by default more or less in favor of the unitary Monarchy was that of the court's surroundings. These are the original coffee barons, the ones with whose support the central government could stand against peasant rebellions and revolutions. And they were also the ones most dependent on slavery. They generally became republicans after Abolition but they were in such dire straits that they couldn't be the pillar of the government even if they wanted to.
And then you have the middle classes. The growing (but still pretty small) sliver of the population which starts the Republican Movement. Doctors, Lawyers, Small Entrepeneurs and the like, they are the sort of people who came into themselves believing in a lot of the fundamental ideals that the Empire itself believed in. The notions of the time concerning government and 'Civilization'. The Empire of Brazil presented itself as a 'Civilizing' entity (read: becoming more like Europe [read: becoming more like France]). As such it would build monuments, schools, spread the national language, rationalize the economy, defend private property, settle and exploit the natives, make sure the peasants don't rise up and so on. The problem is that in the 1880s there is this growing feeling that Brazil itself is being left behind in that same game of becoming a bit more like Europe and, worse, the Empire isn't falling behind just because of inaction. It is actively making things worse. How so? Here's one example: While there were sectors of the middle classes that cared deeply for issues like Abolition and Federalization/Decentralization, they also believe that certain people shouldn't be able to vote. Namely the illiterate who still somehow has the amount of wealth required to vote. That person, they'd say, doesn't vote in their own interests or in the interests of the country. They sell their vote. Likewise, the inability of the government to create an actual school system or the likelihood of chiefs of police in the Imperial Court to call upon shall we say ruffians (black supporters of the imperial family) to intimidate voters or beat down republican gatherings just made these people even more mad. And it only got worse after Abolition. Meanwhile the Argentinean Republic is in it's Golden Age, the Mexicans under the would be technocrat Porfírio Diaz appeals a lot to what sectors of the brazilian army would enjoy in a government, Colombia is doing fairly well, the material gains in the United States can no longer be denied, and France, regardless of it's internal issues, remains the primary reference of the intelligentsia as to what 'european culture' is, and it's a republic. Those who mirror themselves in the United Kingdom are more and more of a minority.
As you can imagine the last gasp of support for the Monarchy came after the Golden Law and the Abolition of Slavery. This is both more and less important than it sounds. It's more important because while there were 'only' 700k slaves out of something like 13 million people, the final abolition of slavery anywhere and in all circumstances concern more than just the recently enslaved. Until about the 1860s if you were black or brown or the great grand son of someone who had been a slave and lived as a free man your whole life it was entirely possible that some landlord could complain to the local judge that you are actually their property and the odds were with them. In, I think, 1851 or 1852 there was even a peasant revolt called the Wasp War where thousands of peasants armed themselves and occupied public squares across the northeast. The reason? The Empire had recently decided to do a public census with unified books. Everyone would be in the same counting, wether they were slaves, former slaves or freedmen or not. And there was a rumour circulating that this was a conspiracy to re-enslave everybody. In the 1860s and onwards judges started denying petitions for re-enslavement but as you can guess there were people whose True and Legal Opinion is that such moves were an unfair treatment of property owners. This is the sort of world that people lived at the time. So it's very hard to overstate how grateful blacks and peasants would feel toward Princess Isabel when she forced the Golden Law through parliament. The Monarchy had finally used it's personal power to make a direct, real difference in a lot of black and brown people's lives so of course they were extremely grateful. But here's the kicker:
They didn't matter.
The Empire of Brazil was not a participatory government. It was not a democracy. It fell many years before mass politics even became a thing in Europe. So while there were groups of capoeiras who closed streets after the Republic was proclaimed they could no longer count on the tacit support of the chiefs of police. The government had changed. Indeed the Empire of Brazil was so centralized that causing it's end was a matter of controlling Rio's main throughfare and merely communicating that fact to the provinces. That was it. The poors meanwhile had never had much of a say in the government of the Empire. They weren't organized or self organizing in a way that could sustain a regime. The purpose of the people, broadly speaking, had been to be Emperor's cortege. They were there work their due and celebrate the Emperor's birthday and the Empire's victory in the War and so on. But they weren't in the halls of power. They were not a part of the Court. A government that never gave a group of people much of a stake in it's processes until it's very end shouldn't expect them to rise up in it's defense. And they arguably didn't. They wished to defend the Princess Isabel and her father from rumours of would be assassins, not the Empire's senators or the liberal conservative cabinet of the Viscount of Ouro Preto. So the capoeiras were quickly dispersed. And that was the end of that.