Context. Every language has this kind of ambiguities, just in different places. Even the fact that English uses he or it doesn't give you much information. You still don't know which he or it. And if you would say "he" to the lion eating a serpent it wouldn't be a big loss.
It could be both, depending on the context, I think. For example when it was about another animal eating the snake, the English would use 'it', but the French would still use 'il', or 'elle' if it is a female animal.