A judge has declared a mistrial in the trial of five current and former Stanford University students charged after pro-Palestinian protests in 2024.