With the Chinese apparently slowly withdrawing from Vietnam, the general view among foreign diplomats here is that the Kremlin has been a winner and a loser in the invasion.

The Soviets have scored substantial propaganda gains by painting the Chinese as "hegemonist" warmongers abetted in expansionist aims by the foolhardy West, and "certain circles" of the Carter administration, they say. This means principally national security adviser Zbigniew Brzezinski.

The Soviets so far have cast themselves in the roll of statesmanlike restraint, adhering to diplomacy, warnings and threats against their adversaries in Peking.

But in practical terms, some here suggest, the Soviets have gained apparently little from the invasion. There is no sign that the Vietnamese asked for more than they have received in the way of military supplies from the Soviets, or that Moscow has achieved its own goal of basing rights in strategic Cam Ranh Bay. At the same time, these sources say, the invasion has shown that the Soviets were confined in their responses to the attack by fears of a potentially disastrous escalation of the conflict.

The Vietnamese economy, already in serious trouble, will need yet more Soviet aid as a result of the new disruptions from the invasion. And the bulk of Hanoi's army remains mired in defensive war in Cambodia, facing fierce and apparently protracted fighting against the Peking-backed Pol Pot forces.

An unmistakable note of frustration was apparent in a speech Friday by Soviet Premier Alexei Kosygin in New Delhi, where he is on a six-day official visit to sign trade and economic agreements with the Indians.

"If an armed robber or killer attacks someone, he is tried in every country in all strictness of the law," Kosygin declared. "But the question ariese what punishment a criminal deserves [who] encroaches on the life of a whole nation, trying to use weapons against other peoples and decide their destinies as he sees fit."

The premier implied punishment will come to Peking, but beyond moral arguments on the one hand and risking a wide confrontation on the other, there was little else he could do.

A 30-year Soviet-Chinese friendship treaty, long since eclipsed by the 1969 border clashes and other less deadly disputes between the two countries, expires next year. Peking has said it has no intention of renewing or extending that treaty.

At the same time, Japanese newspapers have reported that technical talks are underway between the two countries on the Ussuri River navigation question, and Chinese sources here report Peking is Chinese sources here report Peking is ready to begin annual trade talks with the Soviets next month in Moscow.

Reports from Yougoslav sources here say, however, that the talks have been broken off as a result of the Vietnamese invasion.