From my understanding of Brazilian History, the revolt that turned Brazil into a Dictorial Republic was not popular, and indeed the population of Brazil did not want to change away from a monarchial government.
Considering that Pedro didn't want to continue the monarchy, but seemed to obviously care about Brazil, what if after it became clear the Rebels were forming a dictatorship, Pedro II returned to lead a resistance against the coup?
Or, failing that, what if he resists the coup from the start?