Back when I was in the USN there was Judicial Punishment (Court Martial) for all ranks and Non-Judicial Punishment for enlisted (for non-serious less than felony offenses). If you were enlisted you could request judicial punishment instead.
Judicial Punishment had two forms, one with a JAG judge and no jury, or one with a JAG judge and a jury of other sailors. There were JAG lawyers for prosecution and defense, although the accused could retain civilian counsel. It was recommended if you were accused to not have a jury trial, the judge only, would be your best bet.
Non-Judicial punishment in the Navy was called Captain's Mast, presided over by the C.O.- maximum punishment would be any combination of loss of some pay, extra duty & restriction to the command, up to 30 days confinement in the brig and loss of rank (confinement and loss of rank only applied to anyone below the rank of chief); or Executive Officer's (X.O.) Mast (held by the department head with limited punishment, usually extra duty, also called extra military instruction (EMI)). Since it was non-judicial there weren't lawyers or judges, or anything like evidence.
The way it worked was if you were written up for some offense it would go through your chain-of-command. The Division officer would handle it or give the write-up to the Department Head. The Department Head would either have XO's Mast and handle it with EMI, or give it to the Legal Department (JAG lawyer assigned to the ship). The Legal Department would decide if it should go to Captain's Mast (Enlisted only), or Court Martial (all ranks). For less serious offenses for Commissioned Officers they might get a letter of reprimand, instead of Captain's Mast.