A 56-year-old male prisoner has died in hospital after a battle with a terminal illness.