judge advocate
A legal officer in a military court, responsible for prosecuting or advising on military law. This is a specialized term; in modern contexts, the role may be referred to as 法務官 (ほうむかん).
At the court-martial, the judge advocate read out the indictment.