The courts give a great amount of deference to governments and their legislated acts. It is presumed that the laws are constitutional, until proven otherwise.
It is also presumed that public safety is a legitimate goal for governments, even if the government has never provided a reasoning for the law or policy.
At the lowest level of judicial scrutiny, rational basis, it is up to the challenger (plaintiff) to show that the government has no legitimate interest in the law or policy or they can show that there is no reasonable or rational link between between the governments interest and the law or policy being challenged.
As you might guess, since the burden of proof is on the challenger, it is very tough to have a law or policy overturned when the courts use this level of scrutiny.
In the higher forms of scrutiny, the burden of proof shifts and the government must prove that the law or policy fulfills an important governmental interest and that the law or policy is substantially related to achieving the goal. This is called Intermediate scrutiny and is actually a sliding scale, depending upon the law or policy being challenged and the nature of the challenge.
The highest form of judicial scrutiny, strict scrutiny, the government must prove that it has a compelling interest (public safety) and that the law or policy is narrowly tailored to fit the goal.
Long way of saying that no, the government is not required to prove that x will produce y. Only that x may achieve y and then only if strict scrutiny is being applied.