Coin will belong to the user whose transaction is mined first. As far as I understand the miners will include first transaction to the block and then will not include the second one since it makes the block invalid.
It's actually even possible that person B gets the coin even if he submitted his transaction a bit later, but with higher fee. In that case miners will include this transaction and leave out transaction from person A (note that user A won't get any coin in that case).
In general all new transaction are in "pending" state and are not considered "real" until included into some block. You might have actually see this behavior during attack on ropsten
test network: you could submit transaction and it'll actually be visible on etherscan
but it'll be in a pending
state. After about 20-25 minutes without the confirmation transaction is dropped.
The last paragraph of "Blockchain and mining" of ethereum white paper explains it:
A commonly asked question is "where" contract code is executed, in
terms of physical hardware. This has a simple answer: the process of
executing contract code is part of the definition of the state
transition function, which is part of the block validation algorithm,
so if a transaction is added into block B the code execution spawned
by that transaction will be executed by all nodes, now and in the
future, that download and validate block B
If you think of it it makes sense: nothing could be declared as "happened" until it's recorded on a blockchain (and even then it could be "reverted" if longer alternate chain will appear).
So
Does the block needs to be mined so that the amount of token available
in the contract is updated?
The answer is "yes": transfer of tokens is contract execution and it happens while mining and by each block after block is recorded on a blockchain.
More generaly, where is the state of a contract saved between each
block?
As far as I can tell there is no "state between each block". There is a pool of pending transactions and each transaction changes state. So change of state happens only when new block is added.