Did they really fail?
Relational databases did replace them for many tasks
Primarily because they required you to define your queries at database design time.
And because, like SQL, they required a fixed schema. Fixed table schemas are more flexible than fixed hierarchies.