I'm totally stealing @DavidW's idea here (go upvote him!), but how's about, instead of "robot" or "mechanical", we instead search for "automaton"?
Here's a candidate, then, from 1844:
Now Mr BABBAGE, I will tell you what I wish you would do. You have invented a Calculating Machine. Cannot you likewise invent an Engrossing Machine--an Automaton Lawyer's Clerk? The misery of the Clerk at present in use is, that his frame is composed of flesh and blood [...] But, ingenious Sir, could you construct an Automaton Clerk, all these inconveniences would be obviated. Mahogany has no nervous system, springs and wires do nor vibrate with sensations; and to the Attorney's wrong and the Solicitor's contumely, the whole clockwork would be impassible. The machine could not contract matrimony and have to keep a family; and were you, Sir, its Parent, (which Heaven avert!) to fall into distress, it would not be called upon to maintain you. It would bear all kinds of indignity and ill-treatment without a murmur; it could call no meetings, write no letters to the newspapers. Like master and slave, it would be wholly unfeeling. It would work all day, and night too, if necessary, uncomplainingly, till it got out of order; and then it might be mended. Here is a Clerk that would work incessantly, and neither eat, sleep, want payment, or grumble : this, I apprehend, exactly applying the Attorney's grand desideratum--I would advise you to call it THE PATENT INSENSIBLE LAWYER'S CLERK.
-- Punch, 1844
But can we consider Punch of 1844 to be Sci-Fi, any more than The Onion is, today? It was satire, no more.
Debatable, and anyway, I have an earlier contender! In 1827, Jeremy Bentham wrote in Rationale of Judicial Evidence, Specially applied to English practice:
A piece of paper or parchment is provided; the hand of the judge is applied to it; the mind of the judge is not applied to it. So strictly true is this, that by an intoxicated judge, if he had sense enough left to write his name, the business might be done exactly as well as by a sober one: by an automaton judge, a judge made of brass and iron, as well as by either.
But this is an argument. It is not a work of futuristic fiction.
But in the same year, there was written an unquestionable work of sci-fi, The Mummy! A Tale of the Twenty-second Century, by Mrs. Jane Loudon.
And a work of staggering prescience it is, perfectly predicting the woes brought by automation. Surely, these automata bear the logos "Lexmark" and "Hewlett Packard"!
An automaton judge sat with great dignity upon a magnificant throne, looking, though a little heavy, quite as wise and sagacious as judges are wont to look. A real jury (that is, a jury of flesh and blood,) was ranged upon one side of him, and some automaton counsel sate in front, their briefs having behind each a clerk ready to wind him up when he should be wanted to speak; it being found that the profession of the law gives such an amazing volubility of words, that it was dangerous to wind up the counsel too soon, lest they should go off in the wrong place, and so disturb the silence of the court. In different parts of these counsel were holes, into which briefs were being put they were gradually ground to pieces as the counsel were being wound up, till they came forth in words at the mouth: whilst the language in which the counsel pleaded, depended entirely upon the hole in which the brief was put, there being a different one for each tongue.
[...]The orator had paused for an instant from some error in his machinery; but his clerk setting him in motion again, he went on[...]
It was here intended the counsel should bow to the court, but, owing to his defective machinery, he only gave a kind of jerk, and then continued[...]
"[...] let the prisoner be acquitted. But--unless--he--can--make--up--his--mind to--under-go--privations--like--these--let--him--aid--by--his--vote--to--condemn--the--wretch--who--
And here the orator stopt abruptly, being quite gone down. He had indeed uttered the last words gradually slower and slower, and at lengthened intervals, because the attendant clerk had unfortunately given him a turn too little, and had not screwed him up quite tight enough.
[...] At last all was still, and the attendant clerk began to wind up the counsel for the prince. Lord Maysworth watched the moment; but being afraid to trust his beloved brief in his agitation, he popt it in the wrong hole, and when the counsel began to speak, he burst forth in french! Words are wanting to express Lord Maysworth's unutterable consternation at this unfortunate accident.
"Stop! stop!" cried he, "Hush! hush! Can nobody stop him?" but the inexorable counsel would not stop:--for once wound up, and properly set in motion, not all the powers of Heaven and earth combined could stop him till he had fairly run down.
"What shall I do?" cried lord Maysworth, in an agony of despair; "for, if the judge and jury don't understand French, my fine oration will be utterly lost."
"Oh, if that be all," said the clerk, "your lordship need not distress yourself, for as soon as I found what was going on, I ran up to the judge and pulled out his lordship's French stop!"