Hm. At least for the Woolworth sit-in, my impression was that this was store policy, and I'm not finding any source saying that Woolworth was in violation of any law when they gave into the boycott and dropped their policy. But you're right that Jim Crow laws involved mandatory segregation, and that the sit-in was a protest against those laws. Good point, I'm not entirely sure what happened there!
It's probably worth pointing out that the restaurateurs didn't have the ability to make those decisions; that was the point of the Jim Crow legal regime. Left to themselves, they kept wanting to serve blacks.