I would argue that the modern Ys games are Metroidvanias. They’re action JRPGs, but you go out, collect new abilities & characters that help you overcome obstacles in different areas and unlock new maps, then go backtrack and do it all over again.
That being said, I think it’s good to avoid broadening the Metroidvania definition too much further when it comes to RPGs and Dungeon-Crawlers, because half of the games in those genres have elements like upgrades, hidden treasure chests, and lock-and-key mechanisms. I would argue that these features need to be inseparable from the core gameplay loop and the whole game must be designed around “on-rails” exploration for it to count.
So for example, Final Fantasy games don’t turn into a Metroidvania once you unlock the airship, and Skyrim doesn’t become one when you return to a town after a quest with a new ability.