The 8400 is using 2666MHz ram because that's the limit of one of 2 things. On a non-Z rated board, the maximum recognized speed of CoffeeLake cpus is 2666MHz. If that 8400 was planted on a Z370 it could possibly use higher speed ram, but all ram over 2666MHz is listed as (OC), meaning to get stability it's probably going to require a small OC on the cpu since that's where the memory controller is located. Can't really OC a locked cpu like the i5-8400, so that's out too. Meaning the maximum viable speed ram for an 8400 will be 2666MHz.
If the game only uses 4 threads, a Ryzen having 12 thread capability is as useless as boobs on a bull. It'll use 4 threads and thats it. Which gives the advantage to the higher IPC on the Intel. If a game uses 8 threads, you'll get some prioritazation of threads in the 6 thread i5, slowing it down a hair, giving the advantage to the Ryzen which can donate enough bandwidth for all 8 threads simultaneously. The higher Intel IPC can make up that slack somewhat so there's really not much discrepancy, but with longer multiple code strings and higher cpu usage, the Ryzens simultaneous threads will end up less choppy as there's no backlog.
It's a tradeoff. In some games Intel will be better suited, in some the Ryzen, and thats just with the game. If you start multitasking on top of that, the Ryzen stands a better chance of more seemless work than the Intel.
Games for the most part are going to only get more complicated, gamers demands for intense graphics, high detail lifelikeness etc will make that happen. For the middling pc's, this is where Ryzens adaptability will be king, even if Intel still gets a few more fps. It's only in the high end builds using the i7-8700k and its capabilities that Ryzen suffers, simply can't touch the IPC with the full 12 available threads in games that only really make use of @8.