God obliges himself to hear and answer the prayers of those in a state of grace, so that we have a sort of God-given right to be heard as sons. Those in a state of original sin have not yet acquired this right, and those in mortal sin have lost it, so that both of these depend utterly on God’s mercy to be heard and answered. That doesn’t mean their prayers are utterly useless – God is merciful – and how else could they repent? But are their prayers less efficacious in that state? Probably, because the person is turned away from God, and their prayers aren’t motivated by charity.
That said, Fr. Garrigou-Lagrange writes:
The question of the efficacy of prayer interests all souls without distinction: those who are beginning, those who have made progress, and even those in the state of mortal sin, for though the sinner who has lost sanctifying grace cannot merit, he can always pray. (Three Ages, Ch. 33)