Differentiating between mental illness, physical illness (no, a cerebral tumor is a physical illness not mental illness) or drug use can tax us doctors with MRI scans in a hospital. You cant expect a crew to do it, but it shouldnt matter as the captain should remove the individual regardless of any other desk jockies.
If the individual refuses, the use of police is often the only option both on an aircraft and even in a hospital.
The problem is that throughout the western world there is a need to then assess the prisoner and where mental or physical illness is the cause move them into the health system. Sadly prisons in both our countries are wrongly occupied by people with mental illness due to a failure of the criminal justice system, under funding of mental illness and ignorance bordering on vindictiveness from politicians, the media and the public.