The fact that there were 100,000 in total hardly matters - even 10,000 would quickly overwhelm only 300 men (at least 'mortal' men - if they're superheroes then all bets are off

). The key was that the fighting was in a narrow pass with frontage for only a few hundred at most. In any case, there weren't just 300 defenders, there were more like 2,000 - 300 of them were Spartans and the others were allies from elsewhere.