The traders were returning to their neighbourhood after buying vegetables from the wholesale market in Manikganj’s Jaagir.
It has asked the Ministry of Industries to inspect factories throughout Bangladesh and come up with a report within 30 days.
Justice Zubayer Rahman Chowdhury and Justice Md Iqbal Kabir passed the order after hearing a writ petition on Tuesday.
The ruling came 15 days into the death of 13 people in a boiler explosion at a factory, Multifabs Ltd, in Gazipur.
The local administration and fire service formed two separate committees to probe the incident.
Primary investigations indicate that the pressure was created because the boiler’s main delivery valve was closed.
The local administration found seven possible reasons for the explosion, including lack of supervision by the operators.