Irrespective of train being hauled by diesel or electric loco, Currently rakes have 2 means of power generation, Either by dedicated Generator cars at each end, or self generating coaches via Dynamo's that are attached to coach frame under it and driven by moving axles.
--
In case of Karnataka it is the self generating coaches.