Hungary has suspended all traffic from its main rail terminal and cleared the station of hundreds of migrants trying to board trains for Austria and Germany.

Migrants chanting "freedom, freedom" congregated outside the station after being pushed out from the station building, joining hundreds more in what has become a transit zone and place of refuge for those fleeing Syria's war and other Middle East hotspots.

Police acted shortly after authorities announced over station loudspeakers that all trains would be stopped from leaving the station for an indefinite period of time.

Hundreds of passengers with travel documents and tickets remained in the cavernous station, some staring at information boards still showing arrival and departure times

Scuffles broke out earlier among some of the hundreds of migrants as they pushed towards metal gates at the platform where a train was scheduled to leave for Vienna and Munich, and were blocked by police.

Several said they spent hundreds of euro for tickets after police told them they would be allowed free passage.

The closure of the station appeared prompted in part by pressure from other EU countries trying to cope with the influx from Hungary.

Europe has been overwhelmed by a surge of migrants, with more than 332,000 arriving so far this year, according to the International Organisation for Migration.

Police in Vienna said that 3,650 migrants arrived from Hungary at the city's Westbahnhof station on Monday, with most continuing on towards Germany.

"Allowing them to simply board in Budapest... and watching as they are taken to the neighbour (Austria) - that's not politics," said Austrian chancellor Werner Faymann.

While critical of Hungary, Austrian authorities also acknowledged they were overwhelmed by the thousands who arrived by rail on Monday evening.