I believe in India that trains include one or two "generator" cars, often one at each end on longer trains. I don't know if the electric loco's provide power to the trains when connected to the overhead wires, or whether those trains still run with the generator cars. At least with seperate generators, the power would stay on for A/C if the loco itself failed.
Ed.
India is complicated.
Some trains in India have so called EOG (End On Generation), i.e. they have Generator Cars one at each end that deliver Hotel Power to the train.
Other trains consist of self-generating cars, in which each car has a alternator run from one of the axles of the car, and a large battery bank. These cars are basically self sufficient as long as the batteries last. The batteries are charged from the axle driven alternator at speeds above 15kph or so.
EOG and Self Generating cars cannot be mixed in a consist. so a train is either EOG or self generating.
There is a small but growing subset of Electric Locomotives (WAP-5H and WAP-7H) which have an additional inverter to deliver Hotel Power to the train. These are so called HOG (Head On Generation) locomotives. When they are pulling an EOG consist, very often they supply the Hotel Power and the EOGs are not used, but I don;t believe there is any consist (called rake in India) that come with an EOG Car even when a HOG engine pulls them, since there is no guarantee that a HOG engine will always be available.
Add to this the fact that a car may be a screw coupler equipped one or a center (Tightlock) coupler equipped one, and it may be equipped with vacuum brake or air brake, and never the twain shall meet, and you can see the phenomenally complex logistical task that the mechanical and coaching department of Indian Railways manages for hundreds of trains, day in and day out. All engines are equipped with combination coupler that can couple onto both Center Tightlock Coupler and screw coupler, and most can deal with both Vacuum and Air brakes, but the cars are not that versatile. They need to be mixed and matched properly..