I think its actually more probable that Junot is actually beaten back from Lisboa. In OTL his army was said to look like a bunch of starved beggars when they reached Lisboa. Can't see a well-entrenched Portuguese army failing to beat such a tired and hungry army.
To be fair, Dom João VII was a pretty cowardly sort.
Anway, assuming they do capture the Royal Family, they will probably get guilhotined. If no remaining heir, no matter how distant, can be found, BAD THINGS happen.
Portuguese Brazil is administered by Viceroys and nobles, prolly propped up by the British. It would be very similar to how Spanish America was left abandoned when the Spanish monarchy was deposed by Napoleon.
The war finishes with a British Victory as per OTL. Here's where the problems start:
POSSIBILITY 1: Portuguese Civil War
There's no King and no heir. Portugal was a very traditional country at the time. We might see someone decide that a republic would be totally radical, but I doubt they would get much traction and I doubt the British would let that happen. No, the fight would be amongst nobles and burgeoisle, probably drawn on ideological lines, Ancién Regime vs Liberals.
POSSIBILITY 2: Foreign noble takes power or Personnal Union with another Kingdom
Depending on who survives and dies, this might happen. We need to see the Laws and the Marriages and Family ties in the Portugal of that time. I'm betting we're getting a Saxe-Coburg-Gotha or a Hapsburg on the throne. A Portugal PU with England would be very interesting.
I do wonder if the Portuguese aren't going to instantly riot over this. They don't have nice memmories of Personnal Unions there, we all know what happened the last time Portugal did one.
POSSIBILITY 3: Brazilian Fragmentation
Probably going to happen if Portugal enters in Civil War. We might see battlelines drawn on the colonies, or the Brazilians simply use the distraction to secede en masse. Resulting countries might include Grão-Pará, Equator Confederation on the northeast and on the São Francisco river, Minas in most of the southwest and perhaps a São Paulo that also streches to Rio Grande do Sul as well.
One thing I'm sure is that we might either the Viceroys doing a lot of stuff on thheir own (say, trading with Brits). We might see a more developed Portuguese America as the Colonial Monopoly is gone.