Both CPUs are 4c/8t with the Ryzen 5 2400G being newer, has higher boost clocks and integrated graphics.
As for the graphics cards they're rather marginal. Most benchmarks (I've seen) for GTX 1060 and RX 580 tend to trade places depending on the game. Would personally favour the 2400G build if all other components are equal.
What are the rest of the specs for both systems?