The reason why it is useless to pray for people after they have died is that their judgement is in God's hands. We can't change what they have done in life at that point. That's what God is judging them on. God will not see their sin for the purpose of judgement if it has been atoned for by Christ ie. they believed in Jesus and repented iduring life.
https://www.saintjohnchurch.org/prayer-for-the-dead/
First and foremost, the Orthodox pray for the dead because the Bible tells us to. As members of the Church, the Body of Christ, we are exhorted to pray for one another (
James 5:16). Whether we live or die, “we belong to the Lord” (
Romans 14:8). For we are “members of His Body, of His flesh and of His bones” (
Ephesians 5:30). The Church is “the heavenly Jerusalem, the city of the living God”. As such, she includes “tens of thousands of angels” and “the spirits of righteous people made perfect” as well as those of us alive on earth (
Hebrews 12:22-24).
Because of Christ’s resurrection and victory over death, death does not end our membership in the Body of Christ. For neither “death nor life […] will separate us from the love of God in Christ Jesus our Lord” (
Romans 8:38-39). The Orthodox remember that God “is not the God of the dead, but of the living – for all are alive to Him (
Luke 20:38). Therefore, we pray for both the living and for the “dead in Christ” (
1 Thessalonians 4:16).
The most notable examples of prayer for the dead in Scripture are perhaps
Judas Maccabaeus and
Saint Paul the Apostle.
Judas Maccabaeus offered sacrifices and prayers for his fallen soldiers with the future resurrection of the dead in mind. As he said: “It is therefore a good and wholesome thought to pray for the dead, so they may be set loose from their sins” (2 Maccabees 12:39-46). Most Protestant Bibles don’t include this book as part of the canon. However, both the Orthodox and Roman Catholic canons use the Septuagint version of the Old Testament cited by Christ’s apostles in their writings.
Secondly, we have the Apostle Paul, who prays for his departed friend Onesiphorus. As he writes: “May the Lord grant that he find mercy from the Lord” on Judgment Day (
2 Timothy 1:16-18). And so the Orthodox do likewise!