In criminal cases if a court passes a decree on an issue over which it did not have any jurisdiction, it would simply be an irregularity and does not vitiate the trial. But in case a court adjudicates on a crime which should have been adjudicated by a higher court, based on the seriousness of the offence and the severity of the punishment awarded, then the trial gets vitiated and there will have to be retrial at the appropriate court.
In Civil cases, a decree passed by a court without jurisdiction is a nullity and the validity thereof can be challenged at any stage of the proceedings, in execution proceedings or in appeal to higher courts. Its invalidity can be set up whenever it is subsequently an issue in a court proceeding. So disobeying the same would not amount to contempt of court, and if contempt proceedings are initiated, then the invalidity of the original decree can be used to argue against the same in the contempt proceedings. Additionally a writ can be filed against both the original decree as well as the contempt charges in the respective High Court.
Sushil Kuma v. Gobind Ram (1990) 1 SCC 193 (205).