The Book of Mormon does not expressly give the identity of the people who are in the prison at the time of the miraculous manifestation mentioned in Helaman 5. However, a clue as to who these people were is given by Aminadab when he said unto them, "You must repent, and cry unto the voice, even until ye shall have faith in Christ, who was taught unto you by Alma, and Amulek, and Zeezrom." (Helaman 5:41.) The only time Alma and Amulek and Zeezrom were on a missionary trip together was to the apostate Zoramites who were then living in the land of Antionum. (See Alma 31:1-8.) The Zoramites later fled from this area and joined with the Lamanites in the greater land of Nephi, and from this statement by Aminadab we learn they have now occupied the land of Lehi-Nephi, which had just been deserted by Limhi and his people.
Again, the Book of Mormon proves to be a very complex book but also a wonderfully consistent one.