In societies that had eunuchs they basically worked as the court bureaucracy. The general idea being they can hang around the palace and do work but they can't sex up the queen and potentially pollute the noble bloodline.
So I think it would be more reasonable to assume that they lived lives that were above the standard of living of the time, with better nutrition than the rest the population would have had, was the deciding factor in them living longer. This was basically the main selling point of becoming a eunuch, that despite having to get their dick chopped off the live they would live would still be better than life as a peasant and basically one of the only paths available for an extremely low born person to enter noble society. Basically they were in a position where they could eat well, but not wealthy like the nobles that could eat and drink to excess or just make a swimming pool of alcohol if they wanted.