The bus was torn in two when it was struck on the tracks around 7:00 am local time near Sidi Fathallah, about 10 kilometres south of the Tunisian capital.
The ministry said in a statement that five people were killed and another 34 taken to hospital, many with serious injuries.
Local radio station Mosaique FM reported at least 42 injured.
The bus belonged to the public transport service of the town of Nabeul, about 50 kilometres south of Tunis.
More From This Section
Authorities in Tunisia have called for greater caution on the roads following accidents including a collision between a bus and a lorry in August that killed 16 people and injured 85.
In a 2015 report from the World Health Organization, Tunisia had the second worst traffic death rate per capita in North Africa behind war-torn Libya.
Tunisia logged 24.4 deaths per 100,000 inhabitants, according to data from previous years, less than Libya's 73.4 but far more than 2.9 in the United Kingdom.