But they're different systems, designed very differently. A high speed train and a space craft are both designed carefully to maximize their possible life. A cellphone is, unfortunately, been phased into the economy of consumption and planned obsolescence.
Consumer electronics from a few decades are not quite cellphones, but not quite high speed trains or nuclear reactors or space rockets. Many old C64 systems still work or can be restored, and I bet most of our current high end laptops will continue to work a decade from now (you might need to replace the battery).
The OP might have been talking about efficiency, and we have gotten a bit sloppy with that in the consumer world (why does Slack/Atom/Discord need to be a 100MB+ app bundled with its entire web browser and framework? It's like we're in the 2000s with 15 copies of the JDK on your system again!), but once again .. different uses.
A modern SpaceX craft is going to have custom real time operating systems designed specifically to preform much more complex calculations than we've done in previous space missions, hopefully increasing reliability and the amount of sensors we can read, record and transmit data for. The software engineers might be less space efficient in their code than the previous generation, but if the hardware is cheaper and we can increase readability at the expense of memory, why not do it?
In Kim Stanley Robinson's Mars trilogy (highly recommend; best Sci-Fi I've ever read), humans eventually create AI so complex it can manage space factories designed to build from asteroids. The most advanced AI ever created is used to maneuver an asteroid into orbit of Mars while also mining the interior and constructing the cable that would eventually turn into the space elevator over the course of a decade.
The reliability of these systems is indeed quite impressive, yet it simply isn't a requirement for most of our day to day equipment. OTOH some heavy duty machinery can be very reliable.
Something built back then and still works.
Edit: fix markdown syntax.