As Paul is defending the resurrection in 1 Corinthians, he asks, “If the dead are not raised at all, why are people baptized for them?” Is there really something we here on earth can do, such as being baptized, to help those who have already died?
In my guide to Paul’s Journey Letters I explain that he doesn’t actually support baptism for the dead. My understanding of Paul’s reference in 1 Corinthians to those who were baptized on behalf of the dead is that he was talking about something his opponents were doing—the people who denied his teaching about the bodily resurrection. Paul was pointing out how inconsistent and contradictory this practice was, in light of their doctrine: It made no sense to baptize the bodies of the departed through a substitute if those bodies were gone and never coming back. But Paul wasn’t advocating either the practice (baptism for the dead) or the doctrine (denial of the resurrection). He was just delegitimizing his opponents with this rhetorical question.
As for your specific concern, I wouldn’t rule out the possibility that some devotional activities can reach across the divide between this world and the next. Christ’s intercession at the right hand of God for us here on earth is a clear example. (It may also be that God hears and answers the prayers of believers in heaven for people on earth, although we aren’t told about this specifically in the Bible.) So maybe our prayers can also be of some benefit to those who have passed on.
This gets into the larger question of whether everyone’s eternal destiny is fixed definitively at death, or whether people have some opportunity after death to embrace God’s love, and might be helped towards this through our prayers. There are some hints about this in the Bible, such as when Peter talks about Jesus going and preaching to the spirits who were in prison. But we don’t know enough to be able to say for sure.
In any event, baptism itself is only effective, as the church has held throughout the centuries, if the person being baptized has faith in Jesus as Lord and Savior. This faith is not something one person can supply for another. (In infant baptism, the parents or sponsors are doing for the infant what they believe he or she would if able; the expectation is that the infant will later confirm this action as a believer.) The issue in this case, in other words, is the nature of baptism itself, not the question of whether we can do anything for those who have passed on. Prayer, maybe, but baptism, no.