Depends on what you mean by JRPG. Sure Nioh is technically an RPG but I wouldn't label it is a JRPG. It is more an action RPG than anything else, because the focus of the game is a very Dark Souls meets DMC style battle system. Something JRPG's don't have for the most part.
Final Fantasy XV wasn't a flop either in my eyes. Though everyone has their opinions on it. I thought FFXV was great, the combat system was interesting, and not boring, the story was great if a little disjointed in parts, and it had great characters.
The trouble is that the JRPG is evolving, and it isn't moving in a direction that people want which leads people to end up being disappointed. Final Fantasy for example, has always wanted to take the series into a more real-time-action based style, but technology limited them. So for a long time they settles on Active Time battle systems which most people feel in love with. Yet with 12 they moved into a more active based system, first they put in free movement, then they took that out for a more dynamic system in 13, then in 15 they did both.
Now look at something like I am Setsuna, a "traditional" jrpg to a tee, and yet it wasn't as well received as I'm sure they had hoped. It wasn't a bad game, but it ended up feeling like a budget Chrono Trigger without the character. Which leads me to this......
Good JRPG's aren't about the battle system, the mechanics, or even the story for the most part. They are RPG's about character. All the classic "amazing" jrpgs all had one thing in common, fantastic characters. Characters that you will remember long after you turn the game off. Final Fantasy 13 wasn't a bad game, but it had terrible characters, and as a result people hated it. FFXV doesn't have bad characters, in fact it's characters are fantastic which is why it has been so well received.
So to answer your original question. What can JRPG's do to improve. Make good characters. The gameplay doesn't have to blow us away, the characters do (look at Dragon Quest games for good examples).