RAM is literally copy-paste of the same circuit over and over, you're trying to compare cost to produce million AK-47 with 1 carrier
and cost per transistor stopped decreasing at ~20-30nm, now small nodes are targetting energy efficiency (and thus performance, since heat is the main limiter)