The three men and a woman are employed by two companies contracted to build a canal and a section of road after it was washed away following heavy rains.
The situation has caused business activity to stall in the area and cut-off some parts of the city sometimes for hours.
The arrest was ordered by the governor of the Dar es Salaam region, Paul Makonda, and was meant to “serve as an example to others”, Abubakar Kunenge, executive secretary of the region, is quoted as saying by news agency AFP.
Mr Kunege said the four would “spend each night at the central police station and go every morning to supervise the works until [ Mr Makonda] decides the speed of work is sufficient”.
He added that the projects are of great public interest and those “who cannot respect contracts have no place in Dar es Salaam.”
President John Magufuli’s government has become known for meting out summary measures such as breaking or forcing the renegotiation of contracts with foreign companies it considers unfair.