Potential ruling could leave decisions about federal elections in the hands of state legislatures and beyond the reach of state courts