From within an Epicurean point of view, given the existence of power and empathy, there is not a problem here. The bullet-pointed question is on point entirely, but 'when someone in pain dies' is outside the relevant frame of reference, unless that person is you. The release from pain of other people is not something that you can consider. How could you judge the balance of their pleasure and pain? Why would you try to do the impossible?
You are competent to judge your own suffering, and the odds are that objectively considering it, the balance is not no negative you would rather not exist, unless you have honestly rid yourself of the natural human bias toward existing. But if you are really there, dying is in order.
Epicurus would care nothing about the suffering of the dead person, before or after his death, except to the extend that it affects himself. He is not a utilitarian, he is a hedonist, so there is no aggregation of all suffering or pleasure, only the given suffering or pleasure of each individual who has to choose to act. A hedonist still needs to be concerned with others' pleasure or pain because pleasure and pain travel between individuals, and ideas like fairness and safety require communal action to avoid mental anguish.
Others' suffering pains many people. The work on oneself that would protect one from that is the Stoic way, which Epicureanism rejects as too hard to be sensible. Suffering others also often decide to spread their pain around. So removing the opportunity for both seems like a reasonable way to reduce the odds of being victim to either of these effects. That would increase the degree of one's own happiness.
The idea that the release of others from pain would be good does not rely on their having value of their own. It is enough that humans are constructed in a way that borrows pain from others and that pain encourages bad decisions and rash actions that can cause others pain. Since we are others' others, we will be doing some of that borrowing and suffering some of that transferred aggression and poor judgement.