I didn't mean to imply that they are similar aircraft. Interestingly, they have some similar strengths and a similar mission: relatively short-range and high-speed interception. They represent two very different, extreme engineering approaches.
They are both planes that set records for zoom climbing, a performance record associated with their interceptor mission, and some other speed and altitude records:
https://en.wikipedia.org/wiki/Zoom_climb
Anecdotally, one of the more interesting things I've read over the years about their engineering is their failure modes. (who knows how much of this is really true, but it's interesting) Given the correct flight profile, the F-104 will keep accelerating towards Mach 3 right until the canopy material or some other relatively fragile thing starts to fail. The MiG-25 will fly up to the often-quoted Mach 3 number, the airframe is brutally strong, but the engines will be damaged by flying at that speed. But it's entirely possible the Russians upgraded those engines in the eighties. Upgrades to the F-104 over the years only brought the (reported) top speed from Mach 2 to Mach 2.2, but the thing's got razor-sharp wings...