As noted. Very similar in a dogfight. D-25 is a little lighter and will get around on a D-40 in a sustained flat turn...eventually. D-40 has a bit more HP and will hang on the prop a fraction longer. D-40 seems a bit more stable. If you're not overly familiar with P-47s, you probably won't notice any difference. In close quarters combat with equal pilots and E states, its just a coin flip.
If you're a turn and burn guy, you'll might prefer the 25. ZnB maybe the 40.