My :twocents: …
Only the living in this world who are in the state of grace can earn merit with which to pay the temporal debt of their own sins or the temporal debt of the sins of those in purgatory. Those in purgatory itself are beyond earning meriting, as too are those in heaven, and so those in purgatory can’t pray their way out of it.
You might want to think of those in purgatory as those thrown into a debtors’ prison (Matthew 5:25-26) until they work off their debt to “the last penny,” at a fixed rate of say fifty dollars a day. There is nothing they themselves can do to reduce their sentence. However, their sentence can be reduced if someone with means who is outside the prison pays off their debt for them.
The souls in purgatory may be able to intercede for the living, as the dead rich man did for his living brothers from his place of fiery torment. (Luke 16:19-31.) Although, as far as I know, the Church does not officially invoke the intercession of the souls in purgatory in her liturgies, as she does the saints in heaven, she does permit private devotions to the intercession of the souls in purgatory.