There is no ordering problem. The second block must use the first block as an input. If it doesn't then it will be considered invalid.
It's actually the next block to be found after that that determines which is valid. Until then, they are "tied".
Say you have Block 0 that was found 5 minutes ago.
1. Block 1 is found and points at Block 0 as the previous block.
2. A split second later, Block 2 is found somewhere else in the p2p network that hasn't heard about Block 1 yet and it also points at Block 0 as the previous block.
Both chains are the same length and it's not until Block 3 is found that one of the chains "wins" and becomes the valid chain.
3. Ten minutes later, a miner finds Block 3 which will point at either Block 1 or Block 2 as the previous block (depending on which of the two blocks the miner was notified about first via the p2p network). If it points at Block 1, then Block 2 is no longer part of the longest chain and is "invalid". Or if it points at Block 2, then block 1 becomes the "invalid" block.