AFAIK, keyboards and mice aren't any more difficult to see separately than joysticks & gamepads (in mame; about 0% of other apps use RawInput which make it possible in mame). Mame currently supports multiple mice & keyboards, and can tell them apart (disabled by default, though; options -multimouse & -multikeyboard). "Just" map mame1 to use joy,mouse&keyboard 1, and mame2 to joy,mouse,key 2 (but see next PP).
The biggest problem is sharing the video, inputs, and especially sound outputs between two applications. DirectX (video, sound, joysticks) and RawInput (mice & keyboards) aren't really designed for two apps to be actively running at the same time. And you'd need two sound cards to keep the sound outputs separate as (AFAIK) all sound cards are designed for Personal Computers with one speaker system. Heck, windows is designed for a PC, so there's the "active window" thing to get around.
A FWIW, some mameDev are thinking about complete getting mame able to run multiple instances of itself at the same time (mostly for emulating linked cabs). I've heard it's already "pretty far along the way in current mame" over at mameworld.info forums. Don't hold your breath though, I'm guessing it'll be in the twenty teens before done.