It isn't just paying for the "trial" that would be needed, though every bit counts.
If one is contesting an unjust law, one will probably LOSE hard at the trial level. At that level, jury instructions are going to be given that make it quite clear what the jury needs to do with the facts. And the judge does have the ability to grant a judgment notwithstanding the verdict or JNOV should the jury somehow pull off nullification, despite the court's best efforts.
(Please note I am in favor of nullification but it rarely happens and most courts are dead set against it).
After losing at the trial level, you will then have to appeal it. But unless you have a really solid constitutional argument to invalidate the law, you'll probably lose here, too, as the appellate court level in most states doesn't very often overturn laws and legal precedent.
That means you might have to be prepared and funded to appeal or seek cert from a state or the federal supreme court. Keep in mind that it doesn't hear all cases that seek for its jurisdiction.
So, it is a long, hard-fought process to take back the law through the courts.
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."-- Albert Einstein