I won't choose either, dumb girl is way too much of a burden and ugly girl it is kind of hard to get hard with her.
It really come down to how ugly and smart is the smart and ugly girl and how dumb and beautiful is the dumb and beautiful girl. If the dumb and beautiful girl is just slightly dumb, I for sure would pick the attractive one. If the ugly girl is just lower average, that is an acceptable option, if the hot girl is too dumb.
U also need to consider who is nicer and a better person. If the ugly but smart girl is a horrible person, I will for certain pick the attractive but dumb girl (just think of it as, u got a chance to play a knight in shinning armor protecting a damsel in distress, it would make her dumbness that much more toleratable with this ego boost.)
Although in my experience, girls who are smarter and nicer are usually also more attractive then those who are dumber and not so good as a person, but not always the case. A lot of time it is to do with life style, dumb people and people who are not so nice are more likely to have life style that would be more damaging to their body, which as a result, make them get uglier (eg Lindzy Lohan use to be really hot, but due to all of her out of control party, she is significantly much less attractive now) Also, girls who are smart and well educated have more substance and that will usually make a girl seem more attractive, for example Natalie Portman got a PhD in philosophy and is now a full time university lecture and is only a part time actress, even so, she seem even more attractive now than before. Emma Watson went to harvard university, despite she does not look as attractive as back in the day when she was on Harry Potter, she does not see any less desirable (well, until u saw her accidentally leaked sex tape, after that it is like "Whatever, seen that girl doing it already" I accidentally came across the sex tape online. Poor Emma she must be so unhappy about becoming an accident porn star, she should really sue whoever put it online first.)