The guy sounds really odd. It seems like he talked at you for a long time, in a voice so soft you couldn't hear him despite telling him this several times, and didn't get your hints to leave. I think that would be annoying for anyone who had something else they needed to get back to, whether it was work or walking to class or whatever.
Once you realized he was there to pitch himself to you, perhaps you could have said something like, "Actually, I already voted," or "Actually, I've already decided on my choices." Then when he kept going, I think it would have been okay to interrupt and say, "Actually, I'm not interested, and I need to get back to work now." Since you were working right there, I'm not sure what you would have done if he wouldn't go away--I don't know if the other election workers would have been able to help you or not.
Same with the woman. Once you realized she was trying to sell you on her own thing, you might have said, "Actually, that's not something the company is interested in," or "That's not the area of the company we work for." If it was at all relevant, you could have offered to pass her information on to someone else at the company. Then if she wouldn't go away, you could say, "We have to get back to work now; there are other people here we'd like to talk to."
Both you and the other people are trying to sell someone on your product/selves, and that's fine, but I do think there's an etiquette to how much of each other's time you can take. Maybe you could have said to those people, "Cool, I'll listen to your sales pitch if you'll listen to mine." Because you guys are both in the same boat and should have some sympathy for each other with how hard it is to get people's attention these days, etc.--but in both cases it sounds like these people valued their time over yours, and that seems rude.