First question is, "What is your use case?" This would help to decide if either is the perfect truck, or even if you should be looking at another model. Some examples include a preowned 200 series or a Lexus GX460...
Some initial thoughts on '17 SR5P Vs. '22 TRD PRO using the Ben Franklin method below has the 2 choices at a tie. Feel free to try this method out. It's helped me a few times. Other guys on here think it's insane and that these car purchases should be made using only your emotions. Like how much do you want the TRD PRO... In any case,
Keep 2017 SR5 Premium:
Unweighted Score (Pros - Cons): 6 - 5 = 1
Pros
1) Cheaper to keep
2) Has ATRAC and 4lo, so very capable vehicle
3) Not very flashy, but still nice
4) Can add a 1" coilover spacer to lift the front end by 1" to get to same height as a TRD PRO
5) Cheap to put a Dobinson's lift for 2" lift
6) You already have it!
Cons
1) Not that flashy
2) Will need a lift to go offroad safely
3) Land Cruiser 200, LX570 and GX460 have a V8
5) Land Cruiser 200, LX570 and GX460 have full-time AWD
Questions
1) Does the SR5 have a third row?
Buy 2022 TRD PRO:
Unweighted Score (Pros - Cons): 7 - 6 = 1
Pros:
1) Has 1" higher ground clearance
2) Rear locker!
3) More comfortable ride with the Fox shocks
4) Has the Toyota safety suite- automatic braking, active cruise control, Toyota safety connect, blind spot protection (I think?)
5) Apple/Android Car Play
6) Is a bit more cool factor than an SR5
7) Comes with good A/T tires
Cons:
1) Expensive
2) Sometimes too flashy
3) Cannot be had with a 3rd row
4) Land Cruiser 200, LX570 and GX460 have a V8
5) Land Cruiser 200, LX570 and GX460 have full-time AWD
6) Hassle to buy a new car
Other considerations:
To go off road safely, you would be well served to add the following to either model:
1) Aftermarket skid plate/s (RCI is about $400 for front skid and filler plate)
2) Some kind of Rock Sliders (Toyota OEM "Rock Rails" are about $500 and easy to put on in about 30 min)
It's also worth noting that 40k miles on your SR5 is pretty much insignificant. These vehicles will easily go 300/400k miles. Which brings up another point, if you get the TRD PRO, will you be annoyed and want to sell it when the 6th gen 4Runner comes out in a year and is super cool looking and gets 30mpg?!?