I seem to recall a Twilight Zone episode that this reminds me of.
Burgess Meredith was sentenced to death by the government after having been deemed “obsolete”.He managed to lock his guard in the cell with him,(which was rigged to explode).Burgess just quietly sat waiting for the end reading his Bible,while the guard broke into a panic.Burgess finally let him out after the guard pleaded to him,”Let me out,IN THE NAME OF GOD!”
The guard’s superiors were not so forgiving of him for his show of “weakness”.
The Obsolete Man (Twilight Zone)
Synopsis
In a future state where religion and books have been banned, a librarian is judged obsolete and sentenced to death.