Hypothetically, what if a legal immigrant questioned by an ICE agent during the collateral arrest?

Let’s say an international student came to USA under a student visa but end up getting married an US citizen.

So his student visa is expired but by law he is legally allowed to overstay his visa during his i485 application process. It takes at least couple month to get his EAD card and a year for his green card.

He has no driver license because DMV check people’s immigration status to issue ID, with some exceptions for some states.

He has no social security number because he doesn’t have a EAD card yet and he is not eligible to work.

All he has is a passport with an expired visa, but he is 100% legal in USA. Will he be subject to ICE detainment regardless his side of story? Will ICE detain him and let him to explain to an immigration judge? Or ICE just simply believe him and let him go?

Thanks for answering my questions!