The comparison will be made at 25000ft, the altitude of the B-17 raids.
Speed at 25000ft:
P-47D with -63 or -59 engine (cleared for 70" on June 24, 1944): 439 miles true speed
http://www.wwiiaircraftperformance.org/p-47/p47d-44-1-level.jpg
P-51 with -7 engine (cleared for 75" on April 29, 1944): 437 miles true speed
http://www.wwiiaircraftperformance.org/mustang/na-p51b-150grade-level.jpg
P-51 with -3 engine (no data available for 75"): 440 miles true speed with 67", possibly faster with 75"
http://www.wwiiaircraftperformance.org/mustang/fx953-level.jpg
(Note, the -7 engine was tuned for lower altitudes; at 25000ft the -3 engine is superior).
In this aspect, there is little to choose between the three airplanes; the difference in speed is not as great as allowable variation. Even weight change can cause a speed change of more than 3 miles.
Rate of Climb at 25000ft:
P-51, -3 engine, 67": slightly less than 2500 ft/min at 9200lbs of takeoff weight
http://www.wwiiaircraftperformance.org/mustang/fx953-climb.jpg
P-51, -7 engine, 75": 2350 ft/min at 9680lbs
http://www.wwiiaircraftperformance.org/mustang/na-p51b-150grade-climb.jpg
P-47, -63 engine, 70": 2400ft/min at 13600lbs
http://www.wwiiaircraftperformance.org/p-47/p47d-44-1-climb.jpg
(Note, this entire part can only be used as reference, as I have made it very clear that the weight for the three airplanes are different. Further, such weights are impossible to achieve in combat, as it takes large quantities of fuel to fly to Berlin and back. In most cases the P-51 would fight with full internal fuel except an empty fuselage tank if fitted; the same can be said about the P-47. The actual rate of climb depends heavily on the fuel load at which the airplane enters combat.)
Range:
P-47D-25 and on: 2100 miles at 10000ft (no data available for 25000ft; knowing the P-47's performance, it is safe to say that the range at 25000ft is at least somewhat longer)
P-47D-23: 1850 miles at 10000ft, same as above
P-47D-1 thru P-47D-22: 1700 miles at 10000ft, same as above
P-51 with fuselage tank: 2600 miles at 10000ft (no data available for 25000ft)
www.wwiiaircraftperformance.org/p-47/p-47-tactical-chart.jpg
P-51 without fuselage tank and with -3 engine: 2250 miles
P-51 without fuselage tank and with -7 engine: 2290 miles
(Note: the P-51 data included the values of 1800 miles and 1850 miles for the P-51D variant. It is relatively easy to see that the large external tank available to the P-51B and C variant was not included. Due to the similarity in data otherwise, the P-51D can be inferred to have a range of 2600 miles when equipped with the external tank.)
There is very little to choose in the speed and rate of climb performance at 25000ft, any difference is more than likely made up for by the uncertainty of combat situations. The P-51 has an advantage in range, this is more pronounced if the fuselage tank is installed. P-51 has superior rate of turn and the P-47 has superior rate of roll at 25000ft, where the indicated airspeed is low. The P-51D equipped with the -7 engine substantially outruns the P-47 below that altitude; however this is not related to the discussion. The P-47 has a marked advantage in protection and firepower. For missions within the combat radius of the P-47 and altitude above 25000ft, the P-47 has slightly superior speed and possibly rate of climb; however, such a situation is unlikely to occur in Europe. In the Pacific, this role is filled by the P-47N (the only variant to out-range the P-51D). The P-51 is probably operationally more useful as an escort fighter than the P-47D due to the longer range, lower fuel expenditure and ease of maintenance.
P-51H and P-47N are, of course, not taken into consideration here because neither flew escort missions in WWII. The P-51H never saw combat and the P-47N attacked some ground targets near the end of the war.