First, let me say I commend you for playing with your daughters that young — I GMed for my daughters, but not at that early age.
From their perspective, if Parent says this is a fantasy game, and I can do what I want, why is Parent not letting me do what I want? Natural sibling rivalry and age-appropriate selfishness may encourage them to value achieving the goals of their character, only.
So, it may be time to introduce the lesson that You Can't Always Get What You Want - at least not everything you want. If at all possible, try to design a scenario where it is explicit that:
- If the PC's refuse to work together, neither gets anything of what they want.
- If the PC's agree to work together, they can each accomplish some of their goals.
- There is no way either one of them can accomplish all of their goals, at least not immediately.
(It might help to read up on iterations of the Prisoner's Dilemma and/or Mediation and Conflict Resolution)
For example, can you engineer a situation where:
The 3-year old gets to free her friend, but only if she joins the pirates for the time being.
The 4-year old gets to join the pirates, but only if she helps her sister free her friend.
If you can devise a way that they can work together and achieve at least some of their own goals (and explicitly more than they can achieve on their own), you will help them learn to compromise. Of course, it may be that what one or both of them really wants is to frustrate the other one, and this is more important to them than achieving their own goals. If so, regardless of the resolution of this particular story line, this kind of conflict is likely to re-occur so it will be at least valuable for you to suss that out.
In terms of how to achieve the quoted situation above, you know the plot line and details in your game, but here is one idea:
What do the pirates want with the alien — ransom, information, hostage? Whatever it is, have the alien suggest a 'better' target for the pirates to the 3-year old, a target that they can only capture with information that alien has. The alien wants Three to convince Four to convince the pirates to go after this other target. (Or; the pirates know about the other target but the alien refuses to tell them about it — the pirates ask Four to get Three to get the information from the alien).
The 'price' of this information is that Four has to promise to help free the alien against the wishes of the pirates (and there may be alien magic or technology to enforce this agreement if you don't think she will keep her word), and Three has to help the mean pirates capture the new target.
While the pirates would prefer to have both captives, after the dust settles they will recognize that they are better off with the new captive rather than the alien, and will promote Four within the pirate ranking and accept Three. Both girls can, by working together, get something they want but at the cost of having to do something they don't.
In response to Please Stop Being Evil's reminder to support my answer, and concern that unachievable goals will bring about existential dread in a 3-year old:
I am a father of two daughters (currently 21 and 17) and stepfather to a son (33 now but he was 7 when we first met so I did not experience him at 3 and 4). The girls were raised by my wife and me with "attachment parenting". Existential dread is certainly a thing - I believe many of the tantrums of the 'terrible twos' are reactions of distress that accompany the transition from infancy, where a parent can meet all of a child's needs, to toddlerhood, where they cannot. Growing psychological complexity brings the horrific realization to the child that it is not the center of the universe and cannot, in fact, always get what it wants. That is certainly a difficult process. In my, admittedly limited, experience, the worst of that is over by three, and children of three and four can understand things like sharing, taking turns, helping, and empathy, all of which sometimes require setting aside personal goals. Of course, each child is different and there are lots of three and four year olds that are not ready for these things. The OP, or anyone else referencing this question for their own use, knows their children better than we and will need to take that into consideration.
I appreciate your emphasis on temporary vs permanent deferment of goals and have edited my answer to reflect that. Many two year olds would certainly be strongly affected if asked to share their ice cream - that is an ice cream which they will never again be able to eat. Some three year olds, in my experience, are able to console themselves with knowing that perhaps they won't ever be able to eat that particular ice cream again, but that somewhere in the future there is another, different ice cream.
More to the point of the OP's girls, rather than the emotional ability of the children to accept temporary or even permanent deferment of goals, which I believe they may be capable of, is the nature of the emotional contract they have with OP vis a vis "the game". If up until now they have always been able to meet all their goals in the game, and OP is now telling them that they cannot, there certainly is the chance that they will feel betrayal and resentment. Whether or not they are ready to work through this as part of their own emotional growth is best assessed by the OP.