The keyboard should work fine. You are going to have a problem with the mouse, however.
There are basically two types of old keyboards, XT and AT. XT keyboards use a slightly different protocol and only work with XT class computers (like the original PC and XT, and most 8086 clones). Since XTs are dinosaurs, we can pretty much ignore them.
PS2 keybaords, despite having a different connector, are AT keyboards. So, you can use them with a regular KVM switch, although you will have to have a connector adapter in there somwhere to handle the different size connector.
For the mouse, you’ve got a problem. A PS2 mouse uses the same sort of signals as a PS2 keyboard, just a slightly different protocol going back and forth. A serial mouse on the other hand uses RS-232 signals, which are completely different than the TTL level signals used by they keybaord and PS2 mouse. A simple connector change won’t do it. You can change to a serial mouse on the newer computer, then use a KVM switch designed for a serial mouse and PS2 keyboard. You can’t use your existing mice though. They are just incompatible with each other.
PS2 keyboards are basically using TTL level digital signals with the microcontroller in the keyboard wired directly to the microcontroller on the motherboard, with no safety or buffering circuits. They aren’t designed to be hot swapped (unplugged and plugged back in while turned on). The $80 switches have buffering circuits in them that handle the hot swap issue. The $15 switches don’t have any ciruits in them, they are just switches. If you just use one computer at a time and turn them off before switching the keyboard from one to the other then you can use the el cheapo switches. If you switch them under power though you risk damaging the keyboard or motherboard. The risk is a lot smaller than it was back in the days of XT and 286 computers (because of advances in microcontroller designs, so they aren’t quite as fragile as they used to be) but its still a risk.
Serial mice, on the other hand, use RS-232 protocol, which is designed for hot swap.
USB keyboards and mice are also designed for hot swap.
Another solution, depending on what operating system you are using, is to use software called terminal server, which basically allows one computer to log into another computer. You get a window which looks like the desktop of the other computer, and while that window is selected your keyboard and mouse operate the other computer. If you make the window full screen then it looks like you are at the other computer (which causes all kinds of fun where I work… oops, I rebooted the wrong computer!). The down side of this is that the “server” has to be running server software, i.e. NT 4 server, windows 2000 server, etc. The operating systems most people run at home (9.x, NT workstation, 2000 and XP home and pro) don’t have the software to do it. There are 3rd party software programs like PC anywhere which you could use.