This sounds like you bit off a lot more than you could chew. My advice is to just relax and take a breath. It sounds like you did a too much too fast. My advice is to just talk to each group separately and restart both campaigns with them being completely separate.
A fun choice is to have them both be in the same setting, and have the same starting adventure, but they are in different universes. That way you can see how different their stories go.This will solve a lot of the chaotic action that's going on, and reduce your stress by a lot.
Just be honest with your groups and tell them, you are having a hard time handling both groups in the same game, especially if they are being adversaries. Remember, just because your the GM doesn't mean you can't have fun too. Campaigns die when GMing feels like a anxiety inducing obligation.
How experienced of a GM are you? I've been GMing since 3rd edition and even I would feel intimidated by the task you're trying to complete. There's nothing wrong with also telling your players to take a ten minute break, because you need to figure stuff out. If you're struggling to come up with stuff on the fly, even just a couple minutes of a snack and bathroom break can help you think more clearly.