A plan to build 115,000 new homes in Greater Manchester will go to the high court after a judge ruled to allow legal challenge by campaigners.