Though the rape was yet to be confirmed, a Government Railway Police official said the woman fell from the running train and lost her right leg in the mishap.
"We are looking into the matter and the guilty will not be spared," GRP official Sudhir Singh said.
The woman, who was screaming in pain, was noticed by villagers on Sunday morning near Khazakhurd railway station under Sarai Lakhansi police station.
She was lying without clothes, indicating that she might have been raped before being tossed out of the compartment, they said.
The woman alleged that she was going home in Shahganj area in adjoining Jaunpur district by Tamsa passenger train on Saturday night when two men outraged her modesty and threw her out of the moving train.
The villagers brought her to Khurhat railway station for treatment at the district hospital in Mau, but since her condition was serious she was referred to Varanasi.
Photographs of the woman went viral on news channels and social media.
Earlier this month, a college girl received serious head injuries after being pushed out of a moving train by a man attempting to snatch her purse in Bareilly.
The incident occurred near Abhaypura railway station on the Lucknow-Lalkuan section when the girl was going to college with her sister.
Another woman passenger was robbed and thrown off a Lucknow-bound express train by unidentified persons near Chitbaragaon railway station on Chappra-Varanasi section in Ballia district last month.
As per National Crime Records Bureau data, there has been a 52 per cent rise in registered crimes on railways -- from 25,737 in 2011 to 39,239 in 2015.
State-wise, the highest number of crimes in railways has been registered in Maharashtra followed by Uttar Pradesh.
Prevention of crime, registration of cases and maintenance of law and order over station premises and trains is the statutory responsibility of states, which is being discharged by them through Government Railway Police.
On an average, 2,000 trains are escorted by Railway Police Force personnel daily.
Representative image
Triple talaq against women's rights, Centre to tell SC
'Proxy war has to be fought by proxy terrorism'
PHOTOS: Uri army camp attack worst since 2002
JeM behind Uri attack; DGMO calls Pak counterpart
Pakistan tends to resemble a suicide bomber