The Birmingham and Fazeley viaduct - part of the proposed route for the HS2 high speed rail scheme. Photograph: HS2/PA

Ministers have said they will introduce legislation to clear the way for the HS2 high-speed rail project later this year after a legal attempt to halt the £50bn project failed.

The UK court of appeal on Wednesday rejected arguments from 15 local councils, residents' associations and other objectors along the first part of the line that proper environmental assessments had not been made. However, it did allow appeals to the supreme court, leaving campaigners optimistic that they could still stop HS2 or delay it for years.

The Department for Transport said the government would be seeking to reclaim its legal costs for defending its case against the unsuccessful groups.

Simon Burns, the transport minister overseeing the project, said: "By dismissing all seven grounds of appeal and declining to refer the case to Europe, this is the second time in four months a court has rejected attempts to derail HS2.

"Parliament is the right place to debate the merits of HS2, not the law courts and we will introduce the hybrid bill for phase one before the year is out. I urge opponents not to waste any more taxpayers' money on expensive litigation and instead work with us on making HS2 the very best it can be.

"We continue to move forward with the crucial business of getting the scheme ready for construction in 2017 and delivering enormous benefits for the country."

Phase one of the scheme from London to Birmingham and the West Midlands is due to open in 2026, with the full Y-shaped route to Manchester and Leeds to be completed in 2032-33. Opponents say the properties along the proposed line are already blighted. Consultation on the details of the preferred routes for the second phase ends in January next year.

Hilary Wharf, director of HS2ActionAlliance (HS2AA) against the project, said: "We are confident that, at the end of the day, the government are going to have to do a strategic environmental assessment and take their environmental obligations seriously. It's concerning … that we have to go to the highest court in the land to make the government give the environment the respect it deserves."

HS2AA, a body which says it is funded by "£5 and £10" from supporters across the country, argues the decision in principle taken by the government last year to go ahead with the scheme broke EU rules requiring a strategic environmental assessment (SEA). During its initial challenge in the high court in March, it did succeed in forcing a new consultation on calculating compensation for affected properties.

Wharf added that HS2AA's money – its £100,000 in funds for the legal battle would cover the supreme court appearance as well – did not come from taxpayers.

Sullivan said: "If, as I have concluded, an SEA is required and there has not been substantial compliance with the SEA directive, it would be difficult to think of a more egregious breach of the directive given the scale of the HS2 project and the likely extent of its effects on the environment."

Martin Tett, chairman of 51m and leader of Buckinghamshire county council, said: "This is another example of the Department for Transport and HS2 Ltd riding roughshod over public opinion, ploughing ahead regardless of what local communities want and ignoring the environmental merits of the alternatives. We have evidence that our alternative to HS2 would provide all of the capacity required, far more quickly, at a fraction of the cost and would be less damaging to the environment."