At some stations Locos are based due to Operational reasons which are idle and may be used as rescue locos in case of requirement, but even such locos run daily on mainline duties and are regular links of other trains. I will give you an actual example-
.
The loco which comes in to NZB with Pandarpur-Nizamabad(Arr about 23:00) Passenger stays at NZB in the night and another loco takes the rake to depart NZB as NZB-PUNE Passenger. The loco which is stabled in NZB for the night departs with the next night...
more... NZB-PUNE Pass while that day's incoming loco stays. The cycle goes on and on.