True, but non-military agencies don't typically have their own Judge Advocate Generals and courts-martial.
Starfleet certainly isn't militant or military by doctrine or "organisational psychology", but all the evidence that they are military legally (similar to the US Coast Guard or the Japanese Self-Defence Forces)
Are there civilian courts?
Starfleet are the police and they are Prison Guards.
The Doctors case about Intellectual Rights was presided over by an admiral.
Is it possible that Starfleet is the entire Federation legal system?