I got traded a Litleo which is a female and I'm trying to breed a male one from it. Unfortunately I've hatched about 20 of them now and they're all female.
According to Serebii, the gender ratio for females is 3:1 but I still haven't gotten one.
Is it impossible to get a male Litleo off a female one or am I just unlucky?
You're just unlucky. Even if the parent is a female, it can still have male offspring, except for Pokémon such as Kangaskhan that can only be female.
Litleo has a 25% chance to be male and 75% chance to be female, so it is natural that you will hatch more females, just keep breeding and you will eventually get a male.