There were several hospitals that served the several St. Louis area military prisons and several different places to look for records of southern prisoners who were kept there and several places where they were buried (although most were eventually interred at Jefferson Barracks National Cemetery). As you can see, there are several "severals" that make such research difficult.
Please allow the researchers who monitor this forum to assist you, if they can. It would help if you would provide the full name of your ancestor, his county and state of residence, his southern unit of assignment, and the dates of his birth, capture, and death. Providing as much of those facts as possible will place you closer to the answers you seek.