I'll throw in what I've learned from doing this stuff. I drove past a fencing job last summer and stopped to chat with the guy - he was out there all day with a battery powered DeWalt and said he'd never go back to pneumatic for residential work. The thing is, as mentioned above, once you factor in a decent compressor you're looking at real money, and for a one-off project it doesn't make sense.
From my own experience with board games, I'm used to weighing whether gear is worth it for occasional use versus something you'll actually keep using. Same logic applies here. A battery nailer lets you work at your own pace without managing hoses - you're not getting tangled up in air lines while you're trying to focus on straight fence lines. Yeah, you might need to swap batteries partway through the day depending on how big your project is, but that's honestly no big deal. Charge one while you're using the other. The cordless electric ones have come a long way and honestly most folks doing fence work these days are using them instead of pneumatic.
One thing though - if you ever think you might do more projects down the road, that's different. But if this is just a fence, stick with electric. You'll spend less overall, have way more freedom of movement, and you won't need to maintain or store compressor equipment you might never use again.