The incident occurred on an Odakyu Line train, between Seijogakuen-mae station and Soshigaya-Okura station in Setagaya Ward at about 8:30 p.m. local time.
The suspect, who left the knife at the scene and fled, was detained one-and-a-half-hour later, in the neighboring Suginami Ward.
Police were not immediately available for comment.
Video recorded and posted on social media by one of the passengers shows medical workers who were on the train putting on plastic gloves.
Violent crime is rare in Japan but there have been a spate of violent knife attacks by assailants unknown to the victims.
In June 2008, a man in a light truck drove into a crowd in the popular Akihabara district and then jumped out of the vehicle and started stabbing pedestrians, leaving seven dead.