Neither the Sages nor the commentators criticize Eliyahu for the consumption by fire of the captains and their men because Eliyahu's actions throughout this chapter are guided by the Angel of God and not of his own initiative. Ahazya wants to harm Eliyahu not merely as a punishment, but as an attempt to battle God's decree that he will die. God prevails on three occasions: by consuming the first two captains by fire, by the surrender of the third captain, and by Eliyahu's fearless appearance in person to Ahazya. The captains and their men were deserving of their punishment as they chose Ahazya over Eliyahu - God's representative as opposed to the messengers earlier in the story and to the third captain.

Courtesy of the Virtual Beit Midrash, Yeshivat Har Etzion