How does BitCoin prevent fraud during confirmation period?
This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods.

It's not quite as easy as you suggest, though.  When you made your transaction at the cafe, it was, as you say, broadcast across the network.  Barring connectivity problems, every node on the network gets a copy almost immediately.  (They don't need to wait for it to be included in a block.)  In particular, the gas station gets a copy.  So when you try to spend the same coin with them, they know it has already been spent and will reject your transaction.

To make this work, you have to ensure that the victim is not aware of the other transaction.  One approach is that the first transaction, rather than buying some other goods, simply sends the coin back to another address you control.  You don't broadcast it on the network; rather, you give it directly to a miner, with the understanding that they should include it in their next block, rather than the conflicting transaction that sends the coin to the gas station.  In a variant called a Finney attack, the miner (possibly yourself) has already mined a block with the transaction that sends the coin to you, but they wait to submit it to the network until you have bought your gas.