Your friend is building an argument on a false premise. He says, “these men committed the act of Idolatry and therefore would be in a state of Mortal Sin."
We do not know if these men a) committed idolatry or b) died in the state of mortal sin.
Consider the following possibilities:
1.They may have been idolaters, but repented in their final hours or minutes of life, forgetting the tokens were there
2. They may have no longer been idolaters, but carried these tokens of the idols around nonetheless (much like some carry around a rabbit’s foot)
3. They were not idolaters, but carried around the tokens, in violation of human law, but not divine law, making it a lesser sin.
You might think of some others yourself. The point is, we can never truly know if a person has committed a mortal sin, since that would require that we know that the three conditions of mortal sin were met:
a.grave matter
b.full knowledge
c.full consent
When any of these three are missing, culpability diminishes. Only God can judge these things, since only he knows our level of knowledge, our intentions and the circumstances that can diminish our free will (like extreme pressure or fear).
When in doubt, do pray for the dead. And we will always be in doubt, because only God can be the judge of our souls. Our prayers will never go to waste. Some other deserving soul will benefit from our prayers if the person we intended them for cannot use them.