Imagine they have the same hash and the same block header's information. What happens then? Do they spread it to the network and whoever is luckier wins?
If that happened, then the network wont bother since it's the same block
Two miners can't have the same hash of their constructed block header unless they also have the same coinbase transaction (
the "block reward") or it's a SHA-256 collision.
Why? The coinbase transaction will also be used together with the TXs to make the 'hashMerkleRoot' that's in the block header;
SHA-256 has a very-very-very huge number of possible outputs, two different inputs will only have the same hash if they are exactly the same or there's a collision.
-edit- Noticed that it's the same answer as hatshepsut93's, removed and added something else.What you wan't to know is when two different blocks were mined at the same time, then there will be a fork that could create a temporary alternate chain.
If you already got 'Mastering Bitcoin', re-read page 200-204.