> Detection/track ranges are generally much higher.
This is absolutely not true. For modern weapons, the effective range is generally limited by detection, whether you are talking about heavy SAM (like the S-400, with it's 400km range) or modern AAM (like the Meteor or R77M, with ranges ~200km).
As a rule, it's relatively cheap and easy to increase missile range, so they are not limited by ability but by choice. SAM ranges are pushed past reasonable detection ranges because it allows siting the missiles more to the rear, which is safer, and for the missile batteries to provide mutual support. AAM ranges are pushed past detection to increase the size of the no-escape zone, which is usually thought to be more important than the actual maximum range.