Currently the Satoshi client will simply pick the one it sees first. Since most mining pools use the Satoshi client as their connection to the Bitcoin network they will build on top of the first block that is propagated to their node. The block that is propagated the furthest is therefore most likely to be the winner, i.e., the block that is part of the longest blockchain.
As you probably may have guessed there are also other strategies to pick the block to build on top. For example it might be the case that a block with more transactions offers more transaction fees to be claimed, hence a purely selfish miner may replace an earlier block with a new block that offers a higher reward. By that time however the miner has already spent some time trying to build a new block on top of the block with fewer fees, and it might have found a successor already.
So in the end, miners always work on the block they saw first (mining on top of an old block is rarely advantageous), and if they are selfish they may chose to replace their current base for a newer block if it offers more fees. Such a higher value block might however not be propagated to all miners, but that's another story.
For further information on how blocks are propagated in the network see a recent publication: Information Propagation in the Bitcoin Network (http://www.tik.ee.ethz.ch/file/49318d3f56c1d525aabf7fda78b23fc0/P2P2013_041.pdf) (disclaimer: I am author of that paper).
– cdecker – 2013-11-12T19:35:36.9231
Note that an academic paper (preprint) claims that this behavior creates a vulnerability. A mining pool could try to monopolize the network propagation by spawning many nodes, hence becoming able to greatly influence which blocks (its own ones!) more likely arrive first at some other miners, even if they initially withhold their own blocks. They propose to change miners' behavior to make a random choice on which valid block of equal maximum height to mine on.
– pyramids – 2013-11-13T10:27:19.910