Japan gave up her claims to Karafuto in the 1870's in return for Russia giving up all claims to the Kuriles. Russia then tried to renege on the agreement, leading to the Russo-Japanese War where Russia got spanked bad and was forced to return the southern half of Karafuto.
During World War II, Russia had a non-agression/recognition of territorial integrety pact with Japan, an agreement which the Japanese never violated.
Russia has no right to keep any territories seized in the waning days of a war (after the atomic bomb) in which they entered in violation of a treaty.
To take it a step further, North Korea's very existence and China's communist regime owes their founding to Russia's violation of this treaty.
So if we are really going to set things right, the govenment in Taiwan has the right to rule in Beijing and the government in Seoul has the right to rule in Pyongyang.
And for World War 2, if Japan had attacked the Russians, Russia would have been in a pincer between Japan and Germany. Also, Japan would have been able to take sparsely populated land with lots of resources.