Titanium even more so.
For those, they are actively swapped around where cost vs weight trade offs happen.
steel vs aluminum vs magnesium, vs titanium in engineering application, where for example engine blocks, airplane parts, car parts, battery components, etc. all have a long history of this.
It’s a complicated process because the trade offs are not simple cost/weight/strength.
Steel has an nearly infinite fatigue lifetime for instance, so steel springs are great.
Aluminum does not, so aluminum springs are terrible - among other things. No amount of weight savings can likely fix that problem in a useful way.
These pose big challenges in aircraft in particular where aluminum skins and fuselages make flight doable/economic, but means pressurized aircraft in particular have a finite lifespan in pressurization cycles/takeoffs and landings before they fall apart, no matter how nicely you treat them.
Several major accidents (including the top of an airliner coming off and sucking a flight attendant out over the pacific on the way to Hawaii) happened before this was fully understood.
Titanium is in theory much better, but is incredibly difficult to work with(requiring forgings in most cases, and being almost unmachinable), and very expensive as the bond it forms with oxygen is so strong the normal fluorine based processing used with Aluminum won’t work. Yeah, you read that right.
Fire danger (such as magnesium engine blocks burning) is also a non trivial thing to mitigate. Titanium can be one of the worst offenders here (powdered titanium fires can burn SAND used to try to put it out as an oxidizer), which makes working with it hazardous in some cases. Iron, which will also burn, is generally so mellow when it does that burning it is a normal operation while scrapping and cutting it and you can’t get a runaway from doing so except in truly difficult to achieve circumstances (it’s what an oxy-acetylene cutting torch is doing).