Why does 오리가 come after the number here? I would have expected something like 오리 여든 마리가...
You can write it both ways. Your way 오리 여든 마리가 is correct too. The only difference is that if you switch places, you add 의 after the counter word. It might be easier for English speakers to use this form actually since it's the same order (just with a counter word).
I think that many people who are here, they are not English native speakers (+_+)
What purpose does 마리의 serve in the sentence? I was confused on whether or not the answer was ducks or animals.
It seems that, if the number comes before the noun it counts in the sentence, the counter word has to take the possessive particle 의. So, 훈 마리의 개가 있어요, or 개 한 마리가 있어요, both mean "there is one dog". The word order may change which part of the phrase is emphasized.