WAP4's are well proven and very reliable for long runs. WAP7's were initially not used for very long runs, and only in the past few years have they gradually started regular long distance haulage. The type of locomotive is not the reason for the loco reversal/change.
The route via ALLP was only completed in 1992 and Kerala express used to run via KTYM all the time (The bypass was also constructed only in the mid-80's). CHTS used to have a dedicated train to Delhi ( Jayanti Janata) which was cancelled to regularize Kerala express. As a compensation, the Kerala continued to reverse at ERS to provide a daily connection for ERS.
...
more... There is no particular limit on how much a loco can travel in a single run. Being a high priority train, Kerala gets a fresh WAP4 at ED to reduce the chances of a loco failure on the long trip. In addition, the reversal at ERS also makes it easier to use Kerala express to ferry locos from ERS to ED for maintenance instead of running them light.