Those are bankers. These engines are used to "push" the train as the single engine at the front might face issues pulling the train alone while climbing steep ghats. It is also a safety mechanism so that in case a coupling failure (bogies getting detached) happens on a slope, the bogies do not slide and dangerously go out of control.