Better at what?
The Mosquito was better as a bomber, with 1/3 more bomb load.
As a fighter, the P-38 was far and away the better airplane, and more were built. You could put guns on a Mosquito, but it wasn't exactly agile when compared with a single-engine fighter by any stretch of the imagination.
A biggie: The Mosquito had the highest Vmc of any twin. If an engine failed below 165 mph, you were going straight in. By comparison, the P-38 was a docile machine around the patch.
Mosquito P-38L
B Mk XVI
Built ITotal): 7,781 10,037
Top Speed: 415 414
Climb fpm: 2,850 4,750
Range Radius Fighter: 450
Ferry range (miles): 1,300 2,600
Bombs: (pounds): 4,000 3,000
Speed was about a wash. P-38L was MUCH better fighter. The Mosquito was a better bomber. Neither was likely to supplant the other in its better roles. Both were very good airplanes, the P-38 especially after the initial faults were ironed out, and they were. The Mosquito, to it's credit, didn't have too many initial faults.