General assumptions: The last possibility is to ignore both judge and defendant disguises. This is not recommended variant, because even if you put on court security guard disguise or court usher disguise, you could be easily exposed.
You can get to the holding cells in three main ways. The first option is to use court security guard disguise. The best way to obtain such disguise is attacking a guard in the office room on the ground floor (screen above) or in the storage on the floor or in the archive room in the building adjacent to the courthouse. After obtaining disguise you should get back to the courtroom and then bypass characters that can expose Hitman by using Instinct or throwable objects.
Another method is to use court usher disguise. This disguise can be easily obtained by attacking a janitor in the library on the floor of the courthouse (screen above). I recommend using radio or throwable objects to distract nearby guards and then perform the action. After obtaining disguise you should get back to the courtroom and then bypass characters that can expose Hitman by using Instinct or throwable objects. Staying unexposed is bit easier in this case.
The third way involves staying in the default Hitman's suit. You can try to run to the exit (screen above) or use point shooting mode for example and quickly eliminate guards in the courtroom.
All variants described above will get you to the two doors shown on the above screen. If you got a keycard taken from the security room located on the ground floor, you can open the left door. Otherwise choose the right door, leading to the evidence room.
In the evidence room you may encounter at least two court security guards, so you have to be very careful. Locate a ventilation shaft shown on the above screen and get inside, thus bypassing the locked door. Finally approach another door, which directly leads to the holding cells and wait until Agent 47 unlocks it.