In spoken Brazilian Portuguese, the difference between the sound of ele and ela is clear because the first e in ela and ele are different from each other:
Ela sounds like
élah (é sounds more or less like the a in the American pron. of the word bad), and Ele sounds like
êlee (ê sounds like the e in begin).
I am not sure duolingo's bot makes this distinction, but as I said, in real spoken Portuguese, they sound pretty different from each other (at least to us). I hope it helps! =]
You're right about the use of "eles" and "elas". However, if were to say "Do the girls sell books?", I'd say "As garotas vendem livros?" instead of "Elas vendem livros?". Of course, "Elas" is the correct pronoun for "As garotas" and "As garotas" can be replaced by "Elas" if your audience already knows that you're talking about girls.
However, "Elas" is more ambiguous as it can refer to any group of feminine-gender words (not only female people): "As mulheres" [The women], "As jovens" [The youth girls], "As idosas" [The old women], "As crianças" [The children], and even "As tartarugas mutantes ninjas" [The teenage mutant ninja turtles] (okay, I know this is an exaggerate example), etc. The are too many options, and it would be complicated to accept all them.
Anyway, I think Duolingo is trying to make you know the exact meaning of each word, so that's why "Do the girls sell books?" is wrong.