I must be missing something. The OP's question was, "What bullet is longer?" Right? There has been a lot of discussion and nobody has answered the question yet.
So I pulled a Win .25 50gr FMJ cartridge apart as well as a Rem .36 gr hollow-point.
Overall cartridge length: .25 = 0.901" .22 = 0.956
Bullet length: .25 = 0.441 .22 = 0.494
Since the diameter would have to remain constant, I would assume a 40 gr .22 would be slightly longer. If it was solid, round nose, perhaps a little shorter.