"Has achieved whatever work it was in him to do"
Solution 1:
But in an old man who has known human joys and sorrows, and has achieved whatever work it was in him to do, the fear of death is somewhat abject and ignoble.
I would interpret "whatever work it was in him to do" to mean his life's purpose. And "the fear of death is somewhat abject and ignoble" is saying that the fear is abject (self-abasing) and ignoble (shameful). In other words, this old man should consider the fear of death to be an unworthy emotion, one which he chooses to not have (to the extent that that's possible).
Russel goes on to say:
The best way to overcome it -- so at least it seems to me -- is to make your interests gradually wider and more impersonal, until bit by bit the walls of ego recede, and your life becomes increasingly merged in the universal life.
The "it" to be overcome here is apparently the fear of death.