How will transactions be recorded after the last block is mined in 2140?
That is another common misconception. Mining does not stop in 2140. The subsidy is reduced to by half every 4 years approximately (the "halving"), and it will be reduced to 0 by the year 2140, and block rewards after that will consist of only transaction fees.