It is not possible to forgive someone who has died unless the forgiver believes in an afterlife, right?
One can forgive the deceased regardless of the belief system of the forgiver. For example, the forgiver can say something nice about the person to others, preserving a good name, not because of what happened, but in spite of this. The forgiver might donate some money to a charity in that person’s name, again as a generous act of forgiving. So, one can forgive someone who has died. Otherwise, the one who was treated unjustly could be trapped with an inner resentment that could last the rest of the person’s life.