Blockchain length by number of blocks or transactions? It is my understanding that the longest blockchain is the one that should be used.

Is "longest" measured by the number of blocks or the number of transactions?
The longest blockchain is measured by the number of blocks, not the number of transactions. This is because the proof-of-work is linked to the creation of blocks, not transactions.