My guess: duolingo creates these sentences automatically and mechanically translates the 'ihn' to 'him'. The problem with this is that 'ihn' in German can refer to any masculine noun (as Greg already pointed out). Translating it to 'him' doesn't make much sense in the given context, so the sentence should indeed read 'And you drank it?'
In German, would you ever say "Und Sie tranken es?"
In the present tense, do you say "drink him" in German to mean "drink it?" I do not remember this strange gender confusion from earlier lessons. I thought that we typically exchanged "it" for "es", so why is it now changing so that we change "it" for "him" when the noun is masculine?
You would say "Und Sie tranken es" if "es" is about a "das" noun. It's not as simple as "we typically exchanged 'it' for 'es'". If it is a "die" noun, you use "sie", if it is a "das" noun, you use "es", and if it is a "der" noun, you use "ihn". It doesn't matter if it is not a person, you might still use masculine ou feminin pronouns.