Small electric locomotives run on batteries have been used in mines and similar environments for a long time. As batteries are heavy, you would not find them on a full-sized locomotive unless there was a good reason for it. One example would be for running maintenance trains in underground railways when power is switched off.
Thus we have the battery tender attached to the YCG-1 metre gauge locomotives which ran between Madras Beach and Tambaram from the 1930s. As some of the stations had unwired turnouts, the locomotives had a battery tender to run on if the overhead wires were absent.
By the mid-1960s this section was converted to 25 KV AC and electrification was extended to Villupuram (which remained the only electrified metre gauge section in India). These DC locos were retired and a fleet of AC locos took over. The top half of the picture below shows one at the NRM in Delhi, minus the battery tender.
There were also two battery DC locos (this time on broad gauge) delivered to the old BBCI in 1927. They were to be used for shunting where steam locos were considered undesirable for some reason.
In this case (in the lower picture) the batteries appear to be inside the main body of the loco. In the upper picture we see a YCG1 which is preserved at the National Rail Museum in Delhi.
Stranger is the case of the NBM-1 narrow gauge (2-foot) locos, 3 of which were built by BHEL in 1987 for the Gwalior branch lines. No pictures of these seem to be available. But one wonders what purpose they served. Perhaps there was an urgent requirement for replacement of steam locos when no suitable diesels were available. However, these routes have been served by the NDM-5 class diesels which were also built at the same time. But I wonder if there is any example anywhere else in the world where battery locos were used for regular service where there was no electrified line to start with.