Well, Ginger, “mortal sin” requires three things:
Grave matter. Yes, idolatry is grave matter.
Full knowledge. The person committing the idolatry must KNOW that it is grave matter. A person who thought it was not ‘really’ idolatry, or was confused about what idolatry is, or who honestly thought he was not committing idolatry would NOT have ‘full knowledge’. Not to say he isn’t committing a grave sin, but his culpability is lessened.
Full consent of the will. A person who is ‘forced’ into an action by various threats --even less ‘visible’ threats such as the tears and pleadings of loved ones to ‘do’ the action, is not FULLY consenting. Again, lessened culpability.
And finally: the whole ‘repentence’ issue. Even if ALL THREE PARTS ABOVE ARE MET, if the person, on the point of death, has a flash of SINCERE, TRUE REPENTENCE. . .that person can be forgiven by God, as we know from Ezekiel. “If a wicked person turns from sin and repents, he shall LIVE, he shall not DIE”.
And THAT is the reason that these people are prayed for. . .because their friends and family (and those who came after), not being God, do not know 100% that these people met all the conditions for mortal sin. They cannot be sure these people did not REPENT before death. Obviously, if there was lesser sin than sin ‘to the death’, they may be prayed for; and since nothing sinful can enter heaven, they must be purified if their sin was less than mortal until they CAN leave that ‘purgatory’ and enter heaven.