For pure gaming purpose Intel provides best out of the box performance without any fuss, runs silent and cool.
8400/9400 same unit with slight boost in frequency for the latter.
I would suggest get the cheapest out of those two if you are going with Intel.
Now Ryzen offers better performance in productivity scenes where the extra threads shines, but needs overclocking, silicon lottery to minimize the gaming gap.