Bismihi ta'ala
As we have high esteeemed regards and reverence to the Ahlul Bayt (a.s.), and venerate and respect them very much, we avoid prying into things that have absolutely no benefit for us.
When we think of the Ma'sumeen (a.s.), we must think of them in a lofty way, keep away from intrusive thoughts, or questions that won't have any benefit at all.
However, to answer this question, there are some scholars who believe they did not use the restroom, and did not need to relieve themselves.
Other scholars say they are humans, similar to other humans, as the Quran says, and that there are narrations that mention the Prophet (s.a.w.) leaving somewhere, covering his head, and was for the purpose of using the toilet.
We as Shi'ah do believe that nobody at all had ever seen the Ma'sumeen (a.s.) relieve themselves.
We also believe that Ahlul Bayt (a.s.) have been purified, as Ayatul-Tathir [Quran, 33:33] says. This could mean, as some interpret, that if they did relieve themselves, it would not be impure.
In any case, we should focus on what we can learn from Ahlul Bayt (a.s). This matter has no use whatsoever, and is usually brought up by shallow individuals who divert away from the core teachings of our Imams (a.s.).
And Allah knows best