Can I have a PhD in one field, and be an avid academic contributor in another?
In principle there's no problem with that. Many researchers change their fields over the course of their career -- sometimes slightly, sometimes drastically. No one cares what your PhD says on it, just the quality of your work.
There are a couple of caveats. If you need funding for the new field, you may have trouble convincing funding agencies that you're competent to perform the work. And of course it can be hard enough to do good work even when you devote all your time to one field, let alone two (though on the flip side, using insights from Field A may give you a new view on Field B).
But the field your PhD is in, by itself, doesn't limit your activities.
The good news is that what you are thinking of doing is technically possible: if you try to publish a paper in pure math, no one will care if you have a PhD in math, mechanical engineering, Egyptology, or any other subject, or no PhD at all. The only thing that will matter is how good your work is. The PhD itself, or lack thereof, will not be an obstacle in any meaningful sense.
The bad news is that your question reflects a certain naïveté, in the sense that what you are thinking of doing will be extremely difficult to accomplish in practice, to the extent that only very few and rare individuals are talented enough to successfully develop and become successful at two parallel and unrelated academic interests. More specifically, if you don't get a PhD in math and spend the time instead developing a career in mechanical engineering research, it's quite likely that you'll lack both the time and the access to training resources (an adviser, graduate classes) that will enable you to reach a high level as a pure mathematics researcher.
The bottom line is that most people already find it challenging enough to become very successful at one academic discipline, that having the same ambitions with regards to two separate disciplines is a somewhat far fetched notion. It's great to want to pursue multiple interests, and I'd encourage you to keep studying pure math and doing your best to make a contribution to this area for as long as you have the time and passion to do so. But it's best to be realistic about how difficult it would be to do that as a side hobby.
Speaking as someone who is an academic in mechanical engineering and who has had a fairly rigorous training in mathematics, I must say that although it is technically possible to switch fields to pure math, that's a very strenuous path to follow, and I honestly cannot see a more difficult career shift for a MechE PhD than moving from MechE to pure mathematics.
I know several people on a personal level who have done the opposite -- moved from pure math to MechE -- and that's a much easier and smoother transition. But I don't recall having met anyone ever who has done what you suggest, and honestly I don't even see how that would be manageable, even for someone who deals with pure math on a frequent basis, such as those working on dynamical systems and fluid dynamics. Meaningful contributions to modern pure mathematics requires a level of profound knowledge that is far beyond what a MechE graduate student has been trained for, and more importantly, you would have to relearn most, if not all, of the mathematics that you are familiar with, which honestly is harder than learning the "correct" way the first time.
Is it possible? Yes, Ed Witten moved from being a history major to a leading physicist to a Fields medalist. Is likely? If you were to move to any other field, I would say yes, but as for pure math, it is very unlikely to be a successful plan. Research in pure math is very different from research in mechanical engineering.