Amir is definitely heroic in the way that he chooses to go back to Afghanistan at a time when the Taliban are in control and it is incredibly dangerous to visit it. What shows how much Amir has changed is his conversation with Rahim Khan, when he tells Amir the truth about his relationship with Hassan and what has happened to him since. Note the following quote that comes just after Amir begins to argue that he shouldn't return to his homeland:
"You know," Rahim Khan said, "one time, when you weren't around, your father and I were talking. And you know how he always worried about you in those days. I remember he said to me, 'Rahim, a boy who won't stand up for himself becomes a man who can't stand up to anything.' I wonder, is that what you've become?"
Amir, seeing the truth of this statement therefore finally finds the courage to become the hero he has put off being all of his life as he decides to visit Afghanistan and confront his personal demons and his former failure to be a hero.
I actually think it is much harder to pinpoint a specific example of Hamlet's heroism, as his actions are always characterised by procrastination and philosophical reflection rather than heroic battles against the odds. Even the action he does engage in, such as killing Polonius, seems more problematic and rather cruel rather than heroic. If I had to pick a specific section, it would be Act V scene 2, where Hamlet, facing the probability of being killed through some trick of Claudius and Laertes in the duel, shows that he has finally reached a point where he is able to trust in destiny and meet death with equanimity:
Not a whit, we defy augury: there's a special
Providence in the fall of a sparrow. If it be now,
'tis not to come; if it be not to come, it will be
Now; if it be not now, yet it will come: the
Readiness is all: since no man has aught of what he
Leaves, what is't to leave betimes?
There is a kind of heroic dignity in the way that Hamlet is finally able to accept fate and the way it controls his life, and to see a controlling hand in even the death of a sparrow. Hamlet is presented as a man who is finally at peace with himself, and this is heroic given his earlier prevarications.