Full Idea
Sophocles has Ajax (in 'Ajax') and Hercules (in 'Trachiniae') die terrible deaths because of the opposition they represent to the values which are the new values of Periclean Athens.
Gist of Idea
Sophoclean heroes die terrible deaths when they oppose the new Athenian values
Source
report of Sophocles (Women of Trachis [c.430 BCE]) by A.C. Grayling - What is Good? Ch.2
Book Reference
Grayling,A.C.: 'What is Good? The Best Way to Live' [Phoenix 2003], p.20
A Reaction
Presumably they are tragic heroes, who hence invite our sympathy, like Othello and Hamlet, who also die following an older moral code. It is only tragic if the code they follow has something 'higher' about it.