You do realize that Bitcoin evolves, don't you? The "longest chain" has changed to the "chain with most accumulated work" wins, for obvious reasons.
That's actually a noteworthy fact of the Bitcoin history. The whitepaper does include the phrase "longest chain", and while most people believe he meant "longest difficulty-wise chain", he actually didn't. The "longest chain" in the whitepaper is meant literally; the chain with the highest block.
Whitepaper:
The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes.https://bitcoin.stackexchange.com/a/112313However, the original release of Bitcoin did actually use the height to pick the best chain, which was replaced with "most work" after people noticed this attack surface just like you did.https://bitcoin.stackexchange.com/a/29744Satoshi didn't initially realize that choosing the correct chain by just counting blocks allows for some extremely easy attacks. Version 0.1 just counted blocks. That's why the paper just says "longest". The idea of "chain work" was added a little later.Thus, the longest chain is understood to be the chain with the highest computing power or PoW effort, but was implemented incorrectly in early versions. In practice, the longest chain means the highest blockchain in the chain, which should correspond to the chain with the highest computing power according to the PoW consensus algorithm.
There are PoS blockchains that follow the same principle as the longest chain with stakes instead of computing power.