The decision is up to the zone. I was just mentioning that that there is no difference schedule-wise between P4 and P7 links. What loco the train is allotted actually depends on the zone officials' decisions. SR has a very large number of P4's ( ED alone has 118, the highest of all sheds and ED and RPM together have 150+, as compared to 68 for SCR). So, SR is probably preferring P4 for TN and using P7 for other trains.
Loco allocation is not simply decided on which loco is most advanced. SBC and MYS Shatabdi's usually run with WAM4/WAP1 or WAP4 and very rarely with WAP7 and they are the fastest in the MAS-SBC section,...
more... while SBC DD which is also a short rake like the Shatabdis, gets a regular P7 link. These links are mainly allocated based on loco usage plans and loco sharing arrangements, crew availability etc.