I should start by saying that I'm still fairly new to competitive battling.
I've been running a lot of battles on Pokemon Showdown with a team I have in X, and I'm still puzzled about something. On this team I have a Mega Houndoom (mainly because I wanted to use a Houndoom), and it has been out-speeded in two very puzzling situations. My Houndoom runs a Modest nature and has 31 IVs in Speed and 252 EVs towards the stat. In the first case, I was out-speeded by a Terrakion that was not choice scarfed. I know their base speed stats are close, but I thought Mega Houndoom would win the speed race and it didn't. So I assumed it had some speed-boosting nature. Then, I got out-speeded in a different battle by an assault vest Goodra. I just...I'm confused by all of this. Is there a speed calculator to figure out this stuff or am I just missing something obvious? I wasn't paralyzed, no sticky web, etc. It's just really frustrating to believe that I'm gonna win a speed race and then I don't and I wind up losing a Pokemon because of it. Any suggestions?