You are speaking of federal Pre-emption. Federal law does not always trump state law, it depends on the intent of Congress and if they "occupy the field" with the leigislation. If a state law conflicts in litigation it will be up to the courts to decide what law pre-empts the other.
In the case you cite, Obama controls the Justiice department, so if he instructs his US Attorney's to nix it unless there is a compelling need, state law will trump federal law, not as a ruling fromm a court, but the Executive branch.
Here is one case where state law pre-empted federal law.
http://www.law.cornell.edu/supct/html/01-706.ZS.html
If a state were to pass a law that was directly to challenge a federal law, it would be a a test case for the courts.