JIMMY CARTER'S initial untutored enthusiasm for the human-rights cause - since moderated - is coming to a painful denouement in a Moscow courtroom. Evidently thinking to begin his crusade in the citadel of darkness, the new president went early on the offensive in defense of embattled rights figures in the Soviet Union. Thus challenged, the Soviet Union responded by, among other crudities, arresting a young dissident and would-be Jewish emigrant, Anatoly Scharansky, and accusing him of being a CIA agent. Mr. Carter countered by declaring that Mr. Scharansky never "had any known relationship in a subversive way or otherwise with the CIA." That seems to have given the Kremlin pause, the cops arguing that they had gone to a great deal of trouble to concoct a case tarring dissidents and Jews as the tools of American diplomats, correspondents and spies, and could not now turn back, and moderates retorting that too much else in Soviet-American relations would be on the line.

Reports that Mr. Scharansky will soon be brought to trial indicate that the Kremlin debate on Mr. Scharansky - which is, of course, a full-scale debate on how to deal with the new American administration - is nearing an end. Presumably all participants felt Soviet pride and internal discipline required that the young computer programer be tried. As to whether the cops or the moderates have won the larger argument, that will become evident as we see whether the defendant is formally charged with treason or a lesser offense, whether there is a "show trial," whether the CIA allegation is played up, and whether he receives a harsh sentence or is "merely" exiled.

It was leaked in Time magazine this week that, Mr. Carter's defense of Mr. Scharansky notwithstanding, a former dissident who roomed with him a while and then accused him of working with the CIA had himself at one time had a brief fling with the CIA. Our guess is that the leak was meant to preempt a damaging disclosure at a trial. But if anyone needed any further proof of how foolish it is for a president to go around laying his personal prestige on the line in tricky cases like this, here it is.

It is shameful that the Soviet police found it necessary to organize a political charade to smear a few Soviet citizens and perhaps also to undercut detente. If Jimmy Carter may have innocently provided some part of their opening, their exploitation of it cannot be condoned. Since the situation has developed as it has, however, the administration must cope with it. That it has done by letting the Russians know that reckless and inhumane treatment of this inflammatory case can only further curdle the American taste for across-the-board dealings with the Kremlin. Moscow has also quietly but firmly been put on notice that a harsh playing of the Scharansky case will chill the tentative but promising stirrings of fresh American interest in expanding trade. For better or worse, a good part of Soviet-American relations now rests on the way the Russians treat this one man.