A Montana judge on Monday sided with young environmental activists who said state agencies were violating their constitutional right to a clean and healthful environment by permitting fossil fuel development without considering its effect on the climate.