How this goes depends greatly on the laws of the country (or in the U.S. the state) in which the crime occurred. In the U.S. it is not the judge who decides guilt, is a jury of citizens, usually 12 people for a felony. What the sentence would be if convicted depends on the exact crime charged and the laws of the country/state in which the case is tried.