The halacha to circumcise and name a newborn baby boy who has died before his bris milah is brought down in the Kitzur Shulchan Aruch at 163:7:
An infant who died before he was circumcised -- whether within eight days or afterward -- we circumcise him before burial to remove from him his shame, so that he should not be buried with his foreskin intact, since it is a shameful thing for him. However, we do not recite a blessing over the circumcision, but we do give him a name by which to be remembered so that they will have mercy on him from Heaven and he will be revived at the Revivification of the Dead, and he will have the understanding to recognize his father and mother at that time.
The circumcision is not a fulfillment of the mitzvah of bris milah, but is performed only to avoid burial of the child in the "shameful" state of being uncircumcised. See Beur HaGra 263:10. The Kitzur goes on to say that this circumcision is so important that if the baby was buried without doing the circumcision first, and they remembered right after the burial, they should reopen the grave and do it right away. If a few days have passed and decomposition is probable, then they do not do it. K.S.A. 163:7.
Based on the language "within eight days or afterwards" and the references to "shame" I would imagine that an older boy or man, who could not be circumcised because of medical reasons, but would have otherwise, then this law would also apply. As for someone who grew into an adult, and knew about the laws of circumcision, but still did not have it done, I'm not sure this would apply. CYLOR.