Sally,

I think--but am not quite sure--that you are seeking only secondary
material.  I can't believe there aren't books or articles, though none
spring at once to mind.

Perhaps there's no need to remind you of this, but the array of primary
material is enormous--so much in Twain that  that missing it would be
missing the forest for the trees.  Roughing It is only one of several places
(as I recall) where he rails against the stupidity of the jury-selection
system.

But more important, there are trials in several books.  Pudd'nhead Wilson
and Joan of Arc climax in trials.  He makes vicious fun of Arthur's style of
judgment in A Connecticut Yankee.  Tom Sawyer has a courtroom scene (and
later he adds some malevolent comments on the fools who begged that  Injun
Joe  be pardoned).

Imprisonment (if you count that as part of "justice") was one of his most
recurrent  themes or metaphors.  And it may be someone has done a study of
that.  There's a great deal of metaphorical imprisonment, of course--Huck in
his smothery clothes, Tom Sawyer fidgety and trapped in school or church,
the pauper and prince trapped in each other's identities etc. etc.  But more
literally, people are often imprisoned or jailed or put in irons in his
fiction....Muff Potter, Jim, the King and the Yankee, various characters in
versions of The Mysterious Stranger, (again) Joan of Arc...

Last thought on that line:  The painfully drawn-out late section of
Huckleberry Finn, with all the endless rigamarole of Tom's complicated
efforts to free Jim, shows how deeply Twain was versed in a mass of
now-mostly-forgotten memoirs and novels that  hinged on unjust imprisonment
and attempted escape.

It's an awfully rich topic, though I realize I've been no help at all if you
are only seeking scholarly studies.

Happy sleuthing.
Mark Coburn