"The main shutter (of the bakery) was locked from outside, all six got trapped inside and died of suffocation," a fire official told the Press Trust of India.
The six were rushed to hospital where they were declared dead, local media reported.
"The incident occurred due to a short circuit in the bakery premises and investigations are ongoing," police inspector Chaggan Kapshe told AFP.
"We are still identifying why the workers were locked inside."
All six of the dead hailed from India's Uttar Pradesh district. One of the poorest states in the country, it is known as a hub for migrants travelling in search of employment.
Workplace accidents are common in India because of poor safety standards and lax enforcement of existing regulations.
Last month, 13 workers died at an illegal garment factory in New Delhi after a short circuit triggered a fire.