A Thai court has ruled that more than 40 opposition MPs will be tried for attempting to change a law protecting the monarchy from criticism.