The blaze engulfed a carriage of the Nanded-Bangalore Express while it was travelling through southern Andhra Pradesh state, rail officials said.
Police said many of the dead had been trapped inside and suffocated by thick black smoke filling the train.
An electrical short circuit may be to blame, officials say, and an inquiry is under way.
The fire broke out in an air-conditioned carriage around 03:30 local time (22:00 GMT) near the small town of Puttaparthi in Andhra Pradesh.
More than 60 passengers are thought to have been inside the carriage, and the doors were locked as is customary at night, reports said.
Some people managed to break windows and jump from the carriage, but firefighters discovered many bodies heaped up near the doors.