Either cartridge will work just fine. A fair number of pigalinas have been killed with .38 Specials. Headshots are best, whether pistol or rifle.
Once you spot javelinas, they're easy to work in close to from downwind or crosswind. I've even managed to grab a baby, just for the heck of it. Once while sitting and hoping for Bambi to wander by, I had a couple of sows with babies come up from downwind and spend over a minute, sniffing up a storm at the strange critter they'd never seen before. Hard to keep from busting out laughing...