Russian manufacturers has depreciated R&D assets that were paid off during the Cold War era for things every plane needs like controls, life support, landing gears, engines, etc.Then why is it far cheaper than Chinese J-20s despite China holding an edge over Russia in every single way?
J-20 unit costs include not only the marginal cost of the airframe but the amortized cost of R&D for everything including the specialized WS-10C and WS-15 engines.
You can also see with your eyes that the J-20 has tighter machining tolerances with composite while the Su-57 has sloppier tolerances with metal. This will squeeze the last little bit of performance out but is vastly more expensive, not only for tools but if you have a bad piece of composite it can't be reworked like metal, it's junk. So you have to be able to tolerate junking alot of almost good parts.
The last little bit of performance is actually the most important once you are already very good. Going from 95% good to 99% good is just 4% improvement but the probability of failure declined by 5x.