Why would either of them marry Joanna? Prince John, future John II, would oppose that because it would just strengthened the House of Viseu and that was the last thing that the King and the Prince wanted to do. Marrying any of those two, considering that both had claims to the Portuguese Crown, would be stupid.
Problem is that the overall objective of King Afonso V wasn't really to form a union with Castela, that would just be the bonus, he only wanted to avoid a union between Castela and Aragão, because Portugal always wanted to be one doing that union in the long term and because those two combined would have 5 times Portugal's population and territory , and he wanted to force the Castillians to accept Portuguese Hegemony in Africa.
Overall the war went pretty well for Portugal, we won the naval part of it, and the Battle of Toro, while inconclusive, proved to all powers in the Peninsula that the Portuguese army was a power to be recon with. But the war was very unpopular in Portugal, while the army was marching to Toro the Castilians were looting the border regions of Portugal, and many soldiers deserted before the battle or were forced to garrison strongholds in the lands under occupation and but the problem was that by 77 the nobility and the Captains were sick and tired of the war, Africa was much more lucrative for them than a war in Castela.
In the end 3000 men is too small a number to make a real diference, and Portugal had a policy of not using foreign cannons because of the dodgy quality, the Crown favoured hiring German and Bohemian gunsmiths and bring them, and their families, to Lisbon so that they would produce the weapons in Portugal to make sure the quality was the best possible, the gold would be useful, it always is, but money wasn't the problem, between the sugar from Madeira and the gold and slaves from Guinea money wasn't a problem for the crown, the problem is the deep unpopularity of the war in Portugal, if the war had support from everyone Afonso could had fielded a well equipped twenty-five thousand strong army with many experienced Captains from the wars in Africa.
What could change the war, was if France invaded Aragão, even a small army would force Ferdinand to leave Castela to go protect his Kingdom leaving Isabella alone against Afonso and the pro-Portuguese nobility, if that happens then that would place the Castilians loyal to Isabella on the defensive, which means no more looted Portuguese lands, which could make the nobility, and the Captains, more supportive of the war.