Question: Is there a word that expresses the idea that someone has been convicted before trial, either in the media or by public opinion?

Answer: 
I feel like there is no word for this, because it doesn't really exist.

You might have heard the colloquial phrase "tried in the court of public opinion" or "convicted by the court of public opinion" but that does not literally occur. When people say that, it is merely a colourful way of saying "everyone thinks he's guilty and isn't afraid to say so". 

The only time people are literally convicted (punished) like this is called "mob justice" or vigilantism.
The first thing that came to my mind is, that person has been [prejudiced against](http://idioms.thefreedictionary.com/prejudice+against).
Although the word [prejudice](http://www.etymonline.com/index.php?term=prejudice) is nowadays used in other contexts, not together with awaiting trial, it clearly stems from the situation you are asking about.