In its verdict, judges at the Central Jakarta District Court said the actions of the defendants had contravened the law.
The ruling obliges the president to establish national air quality standards to protect human health, and the health minister and Jakarta governor to devise strategies to control air pollution.
"The defendants were found to be negligent at controlling air pollution. We appreciate the verdict, and we are satisfied," Ayu Eza Tiara, a lawyer representing the plaintiffs told Reuters.
The court also ordered the defendants to take other measures, including an analysis of cross border emissions, and for older vehicles to be periodically tested for emissions.
Presidential spokesman Fadjroel Rahman said decisions regarding any further action would fall on the environment minister.
In a message on Twitter, Jakarta Governor Anies Baswedan said his administration would not appeal and was ready to implement the ruling to achieve cleaner air in the capital.
The environment ministry, the home affairs ministry, and the health ministry did not immediately respond to a request for comment.
Rapid urbanisation and chronic traffic in Jakarta, along with nearby coal-fired power plants, have contributed to the poor air quality, according to the Center on Energy and Clean Air (CREA).
In the trial, the plaintiffs argued that authorities had been negligent by failing to protect citizens, pointing to scientific research that air pollution could cause conditions such as asthma, heart disease and lower life expectancy.
IQAir's World Air Quality report for 2020 said Jakarta was the ninth-worst capital city globally in terms of levels of PM.2.5, or fine particulate matter, an air pollutant that can be dangerous to human health in high levels.
Delhi and Dhaka topped the global ranking, but the index showed that Jakarta was the worst in Southeast Asia.