Peter wasn't freed because the church prayed for him.
Nor was James killed because the church didn't pray for him.
We should pray for other people but what God does is still up to Him. I and my whole church prayed for my wife's health but she still died.