Each mining node will build either on A or B (but never both) to extend the chain (so only one or other set of transactions is considered "confirmed" by each of the miners).
If a miner later sees that A or B was incorrect then they perform what is called a re-org which basically means that they undo everything (back the block before A/B) and then redo the transactions using the other block instead (so it doesn't work like any normal accounting ledger and why you need to wait for confirmations before being confident that a transaction should be considered "okay" assuming that you are accepting it for the purchase of goods, etc.).
So you mean all the transactions are not "finally" confirmed until one block chain becomes the main chain right?
Thanks.