North Korea's uses many outdated tanks, mostly T-62s, or based on T-62s, many of which would be expected to be ineffective against the more modern Abrams tank. The S-400 missile system is the best anti-air system and Russia said it would sell Iran the equipment if Iran asked, yet Russia has never proposed selling the missile system to North Korea. The S-400 missile system has an operating range of 400 km and North Korea already has missiles that have a range of 13,000 km, so I don't think it would be against any nuclear proliferation agreement if they were to sell, but it seems both are unwilling to sell North Korea anything. Why?
Maybe this is a bit of circular reasoning, but UN sanctions prohibit countries from supplying North Korea with such weapons (and much more). You might say this reasoning is circular because China or Russia could have prevented these UN resolutions by vetoing them, but they didn't.
A ban is placed on imports and exports of "battle tanks, armoured combat vehicles, large calibre artillery systems, combat aircraft, attack helicopters, warships, missiles or missile systems", "related materiel including spare parts" and any other items identified by the sanctions committee.
The above seems to cover both tanks and antiaircraft artillery mentioned in your question.
For a more comprehensive overview of sanctions by different countries, see the Wikipedia page on sanctions against North Korea.
Why would both China and Russia want to modernize North Korean army in the first place?
They both (mainly China) derive some benefits from the NK behavior, but they don't completely control NK (that's the point of being a sovereign, after all).
On one hand, any improvement in the NK military potential will force both China and Russia, as well as other countries having stakes in the region (including, but not limited to, South Korea, Japan and even USA) invest in their own defense in regard to NK.
On the other hand, the status quo serves well anyone involved in the decision-making, including comrade Kim himself. NK having much more troublemaking potential may make someone around willing to pay the price of changing something in NK (like, e.g. leadership).
And finally, all these things cost money that comrade Kim doesn't really have much of. There is no point in "debt diplomacy" against NK either.
- Your premise is incorrect as to the state of the DPRK army. The Chonma-ho may not be up to the standards of an Abrams, but it is much more modern than the T-34.
- It is unclear if the DPRK really has operational ICBMs. They certainly haven't done as many (successful or unsuccessful) tests as the USA and the Soviet Union did during the cold war. Are their simulation capabilities that much better?
- Western analysts are assuming that the KPA plans on asymmetric operations, both commando raids and large-scale chemical artillery bombardment of Seoul. The S-400 might not be a good investment in that doctrine, more dumb rockets are the way to go.
- The Missile Technology Control Regime has been signed by Russia, but not China. China seems to abide by it, however. It has a cutoff at 300 km and 500 kg.
- As JJJ pointed out in their answer, there are sanctions in place.
- The most important point: The interest of both China and Russia is twofold, making money by selling weapons and checking US dominance and a reunification under ROK control.
- For China, my assessment is that the money angle is certainly secondary to preventing US troops on their border. But they don't want to give the DPRK too much freedom of action, either. They don't trust the DPRK and they see them as disruptive.
- For the Russians, the strategic calculations may differ. But the DPRK cannot pay much.
The premise of the question is that Russia/China would want to arm the North Korea and other rogue regimes just to spite the US and NATO or simply for financial gain. I think their actual calculation is more subtle. Moreover, one argurably draws more benefit from the possibility of selling that from the actual sale. Let me give just a few considerations:
- The other answers and comments have already mentioned that NK may be simply unable to pay for such armaments
- Russia and China would rather keep the military edge over their immediate neighbors. This is particularly the case when this neighbor is politically unstable and may turn against them. While NK cannot be an existential threat to either Russia or China, such a border can generate quite a few problems, as, e.g., Afghanistan does to Russia.
- Similarly, Russia and China would not want to be dragged into a larger military conflict on behalf of the North Korea, the probability thereof could only increase, if the NK is better armed.
- Promising to sell better weapons can be a useful tool to influence the NK.
- Threatening to sell weapons to NK (or not to sell them) can be a useful bargaining chip in negotiations vis-à-vis more serious partners (like the US), in completely unrelated areas of negotiation.
Even during Soviet era... Russia was so smart to not sell "good" weapons to their nearby countries, that as you know were willing to do rebellions.
Bonus answers = in fact the idea of soviet technologies during cold war was not real, analysts analyse weapons of the countries outside russia but as Surokov tells in is book "inside the soviet army", those "monkey version tanks" does not have the features and the quality of the russian ones.