Question: Has the training of Russian troops improved since 1989.
Likely So. The Soviet Union was on it's last legs financially in 1989. 3 years into Gorbachov's Perestroika ("restructuring" the Soviet's stagnated Economy) campaign. Their Military budgets were contracting.
They were no longer able to compete successfully with the west in military spending. It would all collapse in a muffled implosion in 1991 when the Soviet Union would disintegrate and Boris Yeltsin would be sworn in as Russia's first President. In 1989 the Soviet doctrine was to mass troops and equipment. To bring overwhelming numbers. That meant really large numbers of men under arms, and supporting a lot of equipment which was outdated. Stalin once reportedly said, Quantity has a Quality all it's own
Today's Russian army is smaller and better trained.
Assessing Russia’s Reorganized and Rearmed Military (2017)
First, in terms of equipment, experience, attitude, confidence, and more, the Russian military is a radically different force from the one that began the process of transformation in 2008.
NATO Would Be Totally Outmatched In A Conventional War With Russia
In the immediate aftermath of the Cold War, the Russian military underwent a significant reduction in force and capability that transformed it into a shell of its former Soviet-era glory. Both the 8th Guards Army and 1st Guards Tank Army were disbanded, their component units either suffering a similar fate or reorganized into smaller brigade-sized elements reflecting the reality that Russia, like the United States, believed large-scale ground combat in Europe to be a thing of the past; casting the Russian Army circa 2008 as a “near peer” opponent would not have been a flawed assumption on the part of the American military.
Soviet interceptor pilot and defector Viktor Belenko told the west in 1976, that he spent about a third of his training (classroom time ) in political indoctrination classes. He also said that as a pilot and Russian military officer, he was expected to spend weeks at a time annually harvesting Russian crops on communal farms.
Russia like China adopted a more western philosophy of smaller more professional armies after the first gulf war.
What Scares China's Military: The 1991 Gulf War (2014)
In 1991, Chinese military officers watched as the United States dismantled the Iraqi Army, a force with more battle experience and somewhat greater technical sophistication than the People’s Liberation Army (PLA). The Americans won with casualties that were trivial by historical standards.
This led to some soul searching.
Was the Russian Military a Steamroller? From World War II To Today(2016)
In quantitative terms, Russia today is a shadow of its imperial and Soviet predecessors. Russia still has a lot of tanks — 15,000 to 8,000 for the United States, nearly a 2: 1 advantage. However, the United States has superiority over Russia in most other areas: total aircraft 3.8:1, total naval assets 1.2:1.
In nearly every arena, Russia is behind the United States and, often, many other states as well. The United States today has twice as many people. In fact, Indonesia, Brazil, Pakistan, Nigeria, and Bangladesh all have more people than Russia. Russia’s active military of 766,000 is barely larger than North Korea’s. The United States and India have nearly twice as many military personnel, and China has three times as many. China and the United Kingdom spend more on defense than does Russia. India and Japan’s military budgets are only slightly less than Russia’s. The United States far outstrips every other nation in military expenditures with a defense budget ten times greater than that of Russia.
Question: Pakistan army played a key role in Soviet-Afghan War of 1989 and helped the USA to defeat (arguably) Soviets.
As far as the Soviets go I would argue the United States army played little or no role in that war. Rather it was the CIA, US Congressional and Saudi Arabian spending and Pakistani logistics and intelligence which aided the Afghans in that war.
Question: Did USSR's defeat in the 1989 Soviet Afghan War have anything to do with the quality of training of soldiers and/or officers?
Probable. The Soviet Military was primarily trained to do battle in a European war against NATO. I don't think they were especially well prepared for Afghanistan. I think Afghanistan is an incredible difficult terrain for any invading force, and the Soviets could have been better prepared and trained. Then Again the United States didn't fair much better militarily. The US experience was moderated by their less ambitious goals and better strategy to control Afghanistan. The US widely used the checkbook rather than the sword in their Afghan war. The United States never seriously tried to control the countryside, as the soviets did.
I do think the Afghan war accelerated and even was one of a number of causes for the collapse of the Soviet Union. the Afghan war was a terrible unpopular war in Russia. It was expensive in capital and Russian lives. A 9 year war which ended in an embarrassing defeat and ultimate collapse of the Soviet Union. It contributed with the decline in nationalism, stagnation in the economy, the unpopularity of Gorbachev, and ultimately with the disintegration of the Soviet Union.
Question: If yes, has there been any relative improvement in the area of training and strategic planning as compared to NATO since then? Has Russian Federation been able to fill relative the gap?
If the question is, is Russia's military training and equipment better off than it was in 1989, then the answer is likely yes. Likely because nobody really knows how good their military is until they use it. But Russia's military is smaller today than it was in 1989. Smaller means they can afford to spend more money on training their troops. It's expensive to maintain huge numbers of active duty military personnel and that expense is often credited in limiting the training for such forces in the old Soviet and old PLA's models. Russia's best equipment is often newer and as good or better than the West's. But that doesn't really tell the entire story.
If the question is, is Russia's military training and equipment better off than NATO, then the answer is likely not. NATO is made up of 29 countries who have organized their militaries to complement each other and fight together. NATO has a wide disparity of competencies in its member nations approach to defense. Given that NATO has several countries who spend on the same magnitude as Russia. Britain($45 billion) and France's($36 billion) for example combined defense budgets from 2017 outspent Russia in defense spending by about 15%. Individual both have likely outspent Russia over the last decade in defense spending. Then of coarse you have the United States which in 2017 outspent Russia by about 10-1 or $639 billion dollars. United States defense spending is increasing yet again in 2018, and Russia's defense spending will contract for the first time since the early 1990's in 2018. The reported US defense budget for 2018 ($716 billion). A lot of that goes to equipment, a lot of it also goes into training.
While Russia's best equipment is comparable or even arguable superior to Western military equipment, the real tale is told with expenditures. The Russian economy does not allow Russia to spend on the scale that would allow it to field enough of that new equipment to really challenge NATO.