SHANGHAI — Prosecutors in Shanghai said on Friday that they had detained three government officials for their role in a high-rise apartment fire here last month that killed 58 people and injured about 70 others.