First of all, I'm a Canon user, and have not used either of these cameras. But I do a fair amount of photos of my son's baseball and soccer. So here are some general advice when looking for a "sport" camera system.
The lens is going to be the key to getting the shot. Lighting condition will not always be excellent. Sometimes they may have a night game or they play indoor sports. So save some money for a 70-200mm f/2.8 lens. For the Nikon you will need VR image stabilization to get the best result. Pentax has built-in stabilization, so you won't need to worry about IS. The 200mm is really the minimum you need for sports. I shoot at the fence or in the field, and I sometimes still need to crop to get closer when using the 200mm lens.
For the camera body, you need a body that can deliver 5 fps or faster to be considered a sports camera. So the Pentax K-x will be slightly better than the Nikon D5000. It may sound like a small difference, but you may miss that one critical frame. Anything slower than 4 fps is not really a sports camera. Autofocus is also very important. The more sophisticated and faster the AF, the better it is for sports. You need autofocus. Manual focus is for still objects, unless you just want to take pictures at the home plate or the first base. The players move around quickly, you will not be able to manual focus. Nikon D5000 does not have a built-in AF motor, so not compatible with some Nikkor lenses (so you will lose AF and cannot use these for sports photos).
The Pentax company has solid quality and more reasonable price compared to Canon and Nikon. But the main reason many people don't use Pentax for sports is because it is too SLOW for sports, at least for the old models with 3fps or slower. The newer K7 and Kx are about 5 fps, just okay for sports in today's standards. Canon has the 50D, 7D and 1D Mark IV for sports, all above 5fps. And Nikon has the D300s, D700 and D3s. So you can always upgrade when buying Canon and Nikon if you ever find your camera not fast enough or the AF too sluggish. If you buy Pentax, there is no other upgrade.