A federal judge has dismissed a lawsuit by environmental groups that challenged how the nation's largest public utility signs up local power providers for two-decade contracts.