Since you identify the "right thing" as being best for both you and your boss, you better find out what her needs are. One position may be easier to fill than the other, so having you take the tougher one to fill may be in his best interest. Obviously, if you are not happy with the position given, you may be less inclined to stay with the company. Some bosses prefer to keep turn-over to a minimum.
You need to have a conversation about this. Ask what his current thinking is. You have a 50/50 chance of getting the job you want without doing anything. You may find one position is more suited to getting promoted (assuming you want to be promoted). Your boss may have reasons to feel you are more suited for one than the other. One position may be more important/critical than the other and he prefers to have someone doing it that has been with the company and he trusts more.
Maybe you need to get out of your comfort zone and stretch your skills to better prepare you in the long run?
Much of this is going to depend on the relationship you have with your boss. The less open it is, the more difficult it may be to find out what she is thinking. You probably know more about this than any one of us.