The death of Hector strikes modern audiences as essentially the climax of Homer's Iliad, even though it takes places two books before the end of the epic. Additionally, the poet has been preparing the audience for this moment at least since Iliad 6, where we find the touching and poignant scene between Hector and his wife, who pleads with her husband not to go into battle.
In Iliad 22, though, Hector and Achilles finally meet on the battlefield. Hector wavers much in his mind about what he should do after the rest of the Trojans flee behind the safety of the city's gates. Despite his parents' pleas that Hector also return to the city, Hector thinks that his fellow Trojans will consider him a coward if he does not face Achilles.
Accordingly, Hector decides to remain outside the city walls. At the same time, Hector knows that he is no match for Achilles in a one-on-one combat and so he decides to run from Achilles: "His courage gone, he could no longer stand there" (A.S. Kline translation). Given this phrase, it may be difficult to characterize Hector's actions as heroic.
Hector does finally stop running when goddess Athena tricks him into thinking he will receive help from his fellow Trojan Deiphobus. Thinking that he has "backup," Hector's "heart prompts" him "to stand against you face to face". Hector tries to get Achilles to agree that they will respect each other's corpses, whichever of them happens to die, but Achilles will not agree to this.
When Hector realizes that the gods have deceived him, it is at this point that Hector's heroism emerges as, after failing to wound Achilles with his spear, he attacks Achilles with his sword. Achilles, however, strikes back and inflicts a mortal wound upon Hector.
The dying Hector pleads with Achilles to grant him a proper burial, but Achilles refuses. Before Hector dies, he predicts Achilles' own death at the hands of Apollo and Paris.
So, in looking back over the final moments of Hector's life, I am not sure that "heroic" is a term I would use to describe the scene in Iliad 22. I would say Hector looks far more heroic in Iliad 6, when he departs from his wife and child.