By Ognen Teofilovski

NEAR VELES, Macedonia (Reuters) - Fourteen migrants were killed when they were struck by a train in a narrow gorge in Macedonia late on Thursday, part of a growing tide of people trying to get to western Europe via the Balkans instead of crossing the treacherous Mediterranean.

Local media said the victims were among a group of around 50 migrants following the train tracks through Macedonia to Serbia, having probably crossed through Turkey and Greece en route to Hungary and the European Union's borderless Schengen zone.

Macedonia's state prosecutor said that from interviewing survivors it appeared most of the group were from Somalia and Afghanistan. Walking along the railway line after dark, they were hit by a train heading for the Serbian capital, Belgrade.

"The driver saw a large group, dozens of people," the prosecutor said in a statement. "At that moment, he took action to stop the train and engage the siren, at which point some people left the tracks. The train was unable to stop before hitting and running over some of them."

Body parts, clothes and food were strewn along a remote stretch of track running along the Vardar River near the central city of Veles, a Reuters photographer said.

The Western Balkan region is witnessing a sharp rise in the number of migrants using the route to flee war, poverty and repression in the Middle East and Africa.

Record numbers are drowning in the Mediterranean: up to 900 in a single boat on Sunday off the coast of Libya, a major staging point for migrants heading for Europe. On Thursday, European Union leaders agreed to triple funding for search and rescue operations.

In Macedonia, nine migrants have died in the area of Thursday's accident in the last six months.

Cash-strapped Balkan governments say they are struggling to cope with the influx. In 2010, just over 500 people sought asylum in Serbia; that soared to 16,500 last year and over 10,000 in the first three months of this year alone.

The actual number of migrants is probably far higher. Those who claim asylum do so to avoid arrest or immediate deportation, before they slip the net of immigration authorities and continue westwards.

(Additional reporting by Kole Casule in Skopje and Aleksandar Vasovic and Ivana Sekularac in Belgrade; Writing by Matt Robinson; Editing by Mark Trevelyan)