Also, in Act III, scene iv, we hear Portia describing her plan to Nerissa for them to go see their husbands in disguise, as well as her command to her servant, Balthasar, to fetch "notes and garments" from Doctor Bellario - thus we are given a clue that she will be disguising herself as a learned doctor. So, although the audience will see these two girls disguised as men, they will know ahead of time to expect to see them - and they would not be so well disguised as to look completely different from their original selves. That is part of the stage - the audience suspends their disbelief for a time and is in on the hoax.
The audience is able to reconise them because Shakespeare lays this ground work from before they leave Belmont. Remember the letter Portia dispatches to Doctor Bellariothe, the lawyer who is a relative of hers? He furnishes her with "notes and garments".
Portia also informs the audience of her plans when she tells them to Nerissa (Act 3, Sc. 4, line 60-78)