The newly improved Soviet-American relationship seems certain to suffer a sharp setback if two Soviet diplomats convicted of espionage are sent to prison to serve any part of the 50-year jail terms leveled against them yesterday by a New Jersey federal judge.

It was too soon for any official statement or press reaction, but his assessment is based on conversations with senior Soviet officials here this past week, who have made crystal clear this belief that if the Carter administration genuinely desires better relations with the Kremlin, it will see to it that Valdik Enger and Rudolf Chernyayev are sent back to the Soviet Union despite the espionage convictions and long prison sentences.

These officials, including Georgyi Arbatov, a senior adviser on American relations to Soviet President Leonid Brezhnev, say the two Soviets should be treaty the same way the Soviets handled the case of U.S. businessman Francis J. Crawford, who was allowed to return home after he was convicted last month of black market currency dealings.

Arbatov said yesterday, before the sentences against Enger and Chernyayev had been handed down, that "they are innocent and the trial was not fair and this has been stated officially. It will be regarded as some kind of manifiestation of alienation (against the Soviet Union) in the United States. We tried Crawford and he was found guilty and he was sent out."

The lenthy sentences against the Soviets imposed by U.S. District Court Judge Frederick Lacey pose a new dilemma for the Carter administration just as it seemed to have struck rare notes of harmony in its months of discord. Secretary of State Cyrus R. Vance ended two days of strategic arms talks here last week on a cautiously optimistic note and Soviet officials since have given a generally upbeat assessment of prospects for both a new SALT gareement and better overall relations.

But even before Vance arrived Oct. 21, they had made clear they were watching the Enger-Chernyayev case closely as a bellwether of further improvements.

The Soviet press repeatedly denounced the trial earlier this month. Both the official government newspaper, Izvestia, and the influential weekly, Literaturnaya Gazeta, declared that the espionage case was cooked up by U.S. intelligence services to cloud Soviet-American relations at a crucial time.

Izvestia said Oct, 8 the trial was "artificial created" to cause problems that" may adversely affect the climate of relations by complicating the resolution of genuinely important issues" between the two superpowers.

Two days later, the Literaturraya said the trial was a "provocation staged by American secret police to prevent normal development of relations between the Soviet Union and the United States." It called the case "a clumsy farce" that "can only do harm to Soviet-American relations."

These bitter comments of suspicion and anger reflect the deep Soviet view, discernible in conversations with officials, that the espionage case constitutes a test of President Carter's intentions.

The Soviets do not accept the American belief that the Crawford case was a retaliation arranged in response to the May 20 arrests of Enger and Chernyayev. They maintain Crawford was caught red-handed and ultimately released because the Kremlin wanted to make clear its intentions of a better relationship with Washington.