Governments already do dictate what goods can not be carried on their roads. At the very least we have load limits, size limits, speed limits. Then there is dangerous goods regulation meaning you aren't allowed to transport fuel in buckets on an open trailer, and you aren't allowed to transport sand in uncovered trailers either.
All of those regulations are for public safety, and regulate how goods are transported, not what goods are transported. If Oakland could provide some evidence that exporting coal via it's port posed a public safety risk to the people of Oakland, then they'd have had a case. The truth is simply that they don't want anybody exporting coal from the US, and they are trying to majorly overstep the limits of their power.
Or maybe the truth is that coal handling ports produce a lot of particulate pollution in excess of existing regulations which Oakland is sick and tired of policing only to have offenders return to their polluting ways.
The goal of these organisations is to end US coal exports, and that they will abuse the court system with any vexatious lawsuit they can dream up. They had the opportunity to present evidence to support their claim that shipping coal through the city posed any health risk to the community, and they failed to produce any evidence to that effect.
They did produce documentstion to that effect, but Tagami claimed thst using these brand new whizzo coal car covers, no dust would escape (despite having no evidence to support that claim).
The judge basically ruled thst since the report didn't perform a comparison to other sources of pollution, that it was not relevant.
Which I guess is fine if you regard deaths from lung cancer as a statistical measure rather than preventable losses.