Which of these two options is more sustainable? By sustainability here I mean which option causes less environmental footprint when producing the leads or the refills respectively.
It is hard to say because there is such a wide variation in ink formulations. Also, no company is going to tell you what is in their ink, as they will consider that a trade secret. That being said, the only consumable part of a mechanical pencil is made entirely of graphite which is 100% Carbon and Clay. Go with the pencil!
Here is a "How it is made" video on Graphite pencil leads
Here is a video on ink making.
There are two primary issues here, carbon and plastics.
I would expect carbon emissions to be higher for ink, but not significantly. Transport/logistics/retail would be similar for both products and likely has higher emissions than manufacturing.
Modern Ink usually includes micro plastics within the ink, and the packaging for a pen refill also has much more plastic. A fountain pen with traditional ink would avoid this issue obviously.
The half life of carbon is 27 years in the atmosphere, and we are actively dealing with the issue. Plastic on the other hand lasts much longer and is poorly understood (we don't really know the half life for responsibly disposed of plastic - it could be thousands of years).
Therefore, I'd argue pencils are more sustainable. Unless you use a fountain pen with traditional ink.
Very few people use fountain pens today. It follows that few such pens are made. A good fountain pen lasts a long time if you take good care of it. If you have to choose between Parker and Mont Blanc, go with the former (and the one with the gold tips are rumored to last longer):
You can get one on Amazon for under $200.