As a lawyer with a specialty in international law, including human rights, I'd start with the "trial" itself -- assuming, of course, that our dear, shiny Federation is based on such principles. Not that I assume the Universal Declaration of Human Rights is still in effect (after the Eugenics War it probably went into a vault) but basic principles should still be intact, including the right to counsel of one's choice.
Well, keep in mind that this wasn't a Federation matter but a Starfleet matter. This was a military court convened to determine a matter of military, not civilian, law. (Which is why, in VGR: "Author, Author" years later, the Doctor still had to fight for his rights of personhood in a civilian court. Louvois's ruling only applied to Starfleet policy.)
I mean -- Picard and Riker??? Not only do they not have a clue (to paraphrase Tom Paris, "I'm a pilot, not a lawyer") but they are seriously conflicted -- in the legal sense -- and no court on THIS planet would ever pick them to conduct a hearing of this importance.
From my research into the matter (for writing my TNG novel The Buried Age, which dealt with the Stargazer court-martial), there is precedent for assigning officers as counsel in a hearing or court-martial pertaining to people under their command. And conflict of interest doesn't apply, again because we're dealing with a military rather than a civilian court. If you're an officer and you're ordered to prosecute your best friend, you set aside any personal feelings and obey those orders to the best of your ability, or else you're guilty of dereliction of duty. (This is why it was kosher to appoint Louvois to prosecute her lover, Picard, for the loss of the Stargazer.)
Somebody in the thread mentioned the right to resign. Well, yes. I recall one of the actual directives of the Federation (I'm too lazy to look it up) is a prohibition of slavery. If you don't need to prove sentience, and Data is a member of Starfleet -- his pips and evident series of promotions would seem to confirm that he is -- he can get out. It ain't a cult, and the matter should not come before a court at all.
But that's predicated on the assumption that Data is a person rather than a piece of equipment -- and that's the very question of fact that they were seeking to resolve. If Data is equivalent to a human or Vulcan crewmember, then yes, it's slavery. If he's equivalent to a library computer, then no, it isn't. The whole point of the hearing was to determine which of those was the case.
The only real credibility issues I found with this episode in my research pertained to its treatment of the Stargazer court-martial. Namely, there shouldn't have been a court-martial at all. The dialogue claimed that a court-martial is routine when a captain loses a ship, but that's incorrect. What's routine is a preliminary hearing to determine whether a court-martial is necessary.