Anagha Nikam was travelling by rail when she spotted a mother trying to find milk for her baby daughter.
She tweeted to the ministry and asked for help, and milk was provided at the next station.
The ministry is known for being proactive on Twitter, and has helped many distressed passengers in the past.
The baby born in a bank queue in India's cash crisis
Mother names baby born in taxi 'Uber'
Ms Nikam's Twitter communication with Konkan Railway, a division of Indian Railways, happened on 12 March, but the story came to light after the ministry tweeted about it on Thursday.
She was travelling in the Happa Express in the western state of Maharashtra when she used social media to seek help for the family.
Here is how her Twitter exchange with rail staff unfolded:
Ms Nikam was not the only who thanked the officials - others praised the ministry too for being proactive.
India's railway ministry is receiving praise on social media after it acted on a tweet from a train and provided milk to a hungry baby.