Young Adam
(2003)

Joe (Ewan McGregor) is on the outs with Cathie (Emily Mortimer) when she falls off a pier into deep water and he lets her drown. Her current boyfriend is blamed for murdering her and put on trial. Joe agonizes about whether or not to tell anyone the truth, and in the end he writes an anonymous note to the court. No one takes it seriously, and he gives up and lets the innocent man be put to death.
 

Thanks Kyriel!