Russians had focused on SAMs and SSNs during the cold-war and they were actually ahead of the US by the end of the cold war. The Akula-2 SSN was superior to the improved USN Los Angeles class SSN in 1990.
After the end of the cold way, they spent their meagre resources on nuclear weapons, ballistic missiles, SAMs and SSNs and so were able to at least in these areas keep their tech competitive. Look at how bad their attempts at creating a fighter jet on the cheap(SU-57) turned out that the Russian air force does not even want it!
The issue with the S-400 in Syria is that the Russians do not want to start a full-on war by shooting down Jewish and US aircraft that are not in Syrian airspace, and anyway it is forcing them to fire cruise missiles and bombs from long range(more than 100 km away). The days of roaming over Syrian airspace at will is long gone.