Mistrials are a remedy of last resort and there is a public interest in ensuring justice is done, judge says