A court in Delhi has rejected a claim for breach of copyright brought by lawyers acting for the company behind the Harry Potter films.
The model based on the Harry Potter school can now be finished
The ruling means a group in Calcutta building a huge model based on the school for wizards in the Harry Potter books can complete their work.
The huge replica was being made as part of celebrations for a Hindu festival.
Lawyers acting for Warner Brothers, with author JK Rowling's backing, said the event did not follow their rules.
They said the organisers had not applied for permission.
In a statement the lawyers said the court had "recognised that such events cannot proceed without Warner Bros' permission, which should have been obtained", but that it had decided it was too late to stop this event going ahead.
The community group building the model is said to be delighted with the ruling.
The wood and papier mache model, based on Hogwarts School of Witchcraft and Wizardry, can now be used until 26 October when the Hindu festival celebrating the goddess Durga ends.
Members of the construction group say that they make a different model every year - in the past they have built the Titanic.
This year they chose Hogwarts School - as well as life-size models of Harry Potter and his friends.
Organisers said a mock steam engine train is also being constructed next to it, to resemble Hogwarts Express.
Correspondents say the construction, which is nearing completion, is expected to cost around 1.2 million Indian rupees ($30,000).
The finishing touches are being applied to thousands of similar structures, known as pandals, across Calcutta and elsewhere in India.
Many of them touch on popular themes and the BBC's Chris Morris in Delhi says copyright has never been an issue before.