Speaking in Arras, French Interior Minister Bernard Cazeneuve praised the Marines for their timely intervention.
He said: 'Thanks to them we have averted a drama.
'(The Americans were) particularly courageous and showed extreme bravery in extremely difficult circumstances.'
The man was arrested by police near the town of Arras in northern France.
Belgian journalist Marin Buxant Tweeted that the US Marines were on leave in Brussels when they spotted the man and followed him on the train. When the suspect went into the toilet, the Marines recognised the sound of a weapon being armed and decided to act immediately.
Train company Thalys confirmed the incident happened. A spokesman said: 'The situation is under control, the travellers are safe. The train stopped and the emergency services are on site.'
No one at the SNCF French railways was immediately available to comment on the report.
A report on Twitter said that two US Marines detained the gunman until emergency services arrived.
The incident happened at approximately 6pm local time.
The motives behind the attack were not immediately known, although a spokesman for the interior minister said: 'It is too early to speak of a terrorist link'.
The incident happened approximately 115 miles north of Paris near the town of Arras