If Mexico can win or draw they're in. Whoever achieves the better result between Germany & Sweden is in as well. If both Germany and Sweden lose though, they will be in a 3 way tie with South Korea. And if both Germany and Sweden win, they will be in a 3 way tie with Mexico.
Not to worry though, I've coded out every scenario, and they are all reflected in the odds to advance.
Yay for the world cup.