Tourists capture the moving train from coffee shops along both sides of the railway tracks in the Hanoi's Old Quarter. Photo: VNA
In a letter sent to municipal authorities, the MoT said too many cafés had been opened close to the tracks, posing a high risk of accidents.
Statistics from the Vietnam Railway Authority showed that in September only, 24 accidents occurred on railway lines, an increase of 40 percent compared with the same period last year. Nine people were killed in these accidents.
The ministry said that people liked to sit by the tracks to drink, eat and take photos.
It has instructed Hoan Kiem, Ba Dinh, Dong Da and Hai Ba Trung districts to take measures to manage café shops along the railway tracks.
Recently, French-built railroad tracks in the heart of Hanoi's busy Old Quarter have become a hotspot for tourists seeking the perfect Instagram selfie, and for cafe owners serving up hot coffee and cold beer.
"It was amazing but scary in the same sense, a little bit overwhelming being so close to the train," Australian tourist Michelle Richards told AFP.
The tracks were first built by former colonial rulers France who used the railway to transport goods and people across Vietnam, which was then part of Indochina, along with Laos and Cambodia.
During the war against US imperialists, parts of the railway were badly damaged by American bombs that rained down on the communist-ruled north.
Today the original metre-gauge tracks are still a mode of transport for tourists and travellers seeking a cheaper option.
But in the past few years, visitors to Hanoi have seized upon their photographic possibilities.
Hemmed in by houses and cafes, the tracks offer a unique charm for budding travel photographers and a business opportunity for makeshift cafe owners who have set up shops.
"It's got a really weird charm. You've got flowers from the balcony coming down, you've got buildings which are very old and close to each other. You see people here living close to the train tracks,” Hong Kong tourist Edward Tsim said.
As the train rumbles into view, everyone clears the tracks and pulls their phones out to capture the scene.
"It felt like waiting for Christmas... and when it arrived, wow, it was something else," British tourist Paul Hardiman said. "Well worth the wait."