This is how it shapes up.
If the Yankees win and the Rays lose, Yanks are Divisional Champs and Rays the Wild Card. If the Yanks lose and the Rays win, the reverse is true.
OTOH, if they both win or both lose, most likely there will be a one game playoff to determine the Divisional Champ.
Now, in the NL it is even worse. If the Pods win and the Braves win, a one game playoff to determine the Wild Card. Same thing if they both lose. If the Pods win and the Giants lose, a one game playoff to determine the NL West Champs. But, if the Pods win, Giants lose and Braves win, they have to play for NL West Champs and the loser will have to play the Braves for Wild Card team. There's more, but this is bad enough...
The Situation Now...