…If it were to happen, it would most likely happen under period of Philipp II’s rule and unification. Say in the early 1580s, in part to keep his subjects from squabbling, and to make things more "tidy" King Philipp decides Spain should have a monopoly on the New World colonies and Portugal should have a monopoly on the East Asia - West Pacific colonies. This would still be in the very early years of colonization in both countries.
Long-term impact…Philippines will have elements resembling Macau and East Timor culturally. The islands may be renamed after Portuguese independence restored, to the Braganzas or to the Joaos, the Henriques or the Magellans.
This Portuguese influence creates the chance that independent kingdoms/sultanates may survive longer in the islands, or that all or part of the archipelago, including Luzon and Manila, falls to the Dutch. (then who knows what happens in anglo-dutch wars. Philippines are more multicultural, a little less inquisition-y, with more exchanges with the Indian subcontinent and Africa.And leading possibly to more Tagals/Malays being involved in Africa.
In Brazil, the south develops along the lines of Argentina and Uruguay. The northwest European powers probably still take te Guyana coast.The north may be less developed. Forces of climate and profit, may drive a focus on plantation slavery and sugar much like OTL’s, in which case the Spanis crown is poorly positioned to profit from the slave trade in comparison to Dutch, English, Portuguese and even French traders.
Alternatively, sugar plantations may be less extensive, the church and missions may own more of the land, and the emphasis may stay more of mining and ranching and forestry as opposed to sugar growing.
Portugal also keeps much more of its population without Brazil becoming as established as *the* wide open frontier in the Portuguese consciousness. Castille however, may see a proportionate rise in emigration.