Ryzen 5 for sure, It is plenty powerful enough for any AAA title for years to come. Your graphics card is much more important. Just make sure you meet the recommended requirements for RDR2 and make sure you have enough ram. The Ryzen 5 is also the newer of the two you mentioned. See how little the difference is below:
https://www.cpubenchmark.net/cpu.php?cpu=AMD+Ryzen+5+2600&id=3243
https://www.cpubenchmark.net/cpu.php?cpu=AMD+Ryzen+7+1700X&id=2969
Here is a build that will very comfortably play RDR2, just add a case and other extras if needed: https://pcpartpicker.com/list/yd3yXv