It really depends on how the specific games are optimized for Ryzen CPUs. As of now, when gaming in 1080p resolution, the i5-7400 will achieve higher FPS than the Ryzen 5 1400 at stock speeds (https://www.youtube.com/watch?v=zF5B2qQEJzs). Lower resolution have a huge gap in FPS between the Ryzen and the Intel CPUs, but as you go higher (1440p, 4K), the gap closes in, and depending on the game, may go over (https://www.youtube.com/watch?v=sqynzMHFCVc).
Higher resolution, overclocking potential and RAM speeds could play into the Ryzen's advantage of having it perform better with higher FPS with the GTX 1080 Ti at 4K.
But if you are considering a better alternative to the i5-7400 (which costs ~$190), I'd rather consider the 6-core/12-thread Ryzen 5 1600 (which costs ~$200) instead.