How does the network know the legitimate chain in a double-spend attempt? Apologies if this has been covered, but there's one area of the Bitcoin network that is not clear in my head, and it's intimately linked to the double-spend problem.

Suppose Person A is purchasing an item in a store.  They "pay" Person B 1 BTC for a good and broadcast this transaction to the network, which Person B sees as unconfirmed.  The transaction is included in a block (Block 1) whose Proof of Work is now being found/solved.

Suppose Person A controls 30% of the Bitcoin mining network (arbitrary high proportion), and has his miners instead mine a different block (Block 2) containing a transaction spending the same BTC to a different wallet controlled by Person A.  

Suppose the Proof of Work for Block 2 is, against the odds, obtained first, and the "corrupt" miner who finds the requisite hash broadcasts it to the entire bitcoin network.  This is where my understanding breaks down.  What exactly happens when the remaining 70% see this transaction?  Do they stop mining Block 1?  At what point can Block 1 be orphaned?
Imagine the blockchain as... a chain of blocks

The situation is:

A -&gt; B -&gt; C
      \-&gt; C'


But some nodes see it as  A -> B -> C and mine over the block C

and some other see A -> B -> C' and mine over the block C'

If node sees something like this:

A -&gt; B -&gt; C -&gt; D -&gt; E...
      \-&gt; C'-&gt; D'-&gt; E'...


it should select the chain with larger cumulative difficulty (longest) and forget anything about orphan chain