Sage advice helped clarify this, in exactly this circumstance too
Jeremy Crawford, lead rules designer, stated over a twitter Q&A that
Q: Truesight lets you pierce/nullify illusion effects like the ones create by Phantasmal Force (in the mind of a creature) & Mental Prison (the target to perceive itself as being surrounded)? These spells are considered visual illusions for the purpose of Truesight?
A: A visible illusion is something illusory that you can see with your eyes. If an illusion is perceived only within someone's mind, that's not a visible illusion, even if the person thinks they're seeing it.
So, a visible illusion isn't something that affects the mind of the target, it's something, well, visible. It has to be some illusion that creatures actually see with their eyes, and not only see in their mind.
If the text of the effect says that the target "believes" that they see something or that it "takes root in the mind" of a creature, then Truesight won't be effective. But if the illusion is plain for anybody to see, then Truesight would see through it.
In your case, the creature is still affected
As the tweet clarified, since Mental Prison only affects the mind of a creature, it cannot see through the illusion with Truesight. This is because the creature is not witnessing the illusion with their eyes, but rather in their mind.