Do I think Trask was justified? Heck yea! Why wouldn't he be? And do I think that HE thought he was justified? Well, of course. Otherwise, why would he have come back to brick Barnabas up?
Come to think of it, I think Trask was MORE fair to Barnabas than Barnabas was to him back in 1795 when he bricked him up. Barnabas didn't give Trask any way out of the situation. It was "Here, sign this letter and then get in that alcove there while I put bricks in front of you." That was that. At least when Trask came back as a ghost in the present day storyline, he summonded ghosts of the past who Barnabas had "wronged" and gave him a trail. Sure, it wasn't a completely fair trial, but it was more than Barnabas did for Trask in the first place.
Ultimately, did Trask deserve to be bricked up? Probably not. But given the circumstances and Trask's extremely crafty ways, Barnabas really couldn't trust that Trask would go to the courthouse and freely state that he was wrong about Vicki, and that he recanted all his testimony and his entire case basically. Who did Barnabas know that would accompany Trask that would seem to be credible? No one. Ben was only a servant after all, and Barnabas couldn't do it for himself because he was too busy snoozin' away in his coffin all day. So, really, Baranbas' only option was to somehow keep Trask captive and then make him visit the judge's offices or home at night, which would've been highly risky (Barnabas could've been seen), or to kill Trask after Trask signed a confession. The latter of the two seems the easiest.