Well OP, clearly you came to the right place to ask, seeing that apparently half of this board's population is made up of experienced boar wrestlers.
In all seriousness, probably not. A hollow hiking pole would bend, and unless your hiking stick is a proper thick ass staff, the boar might not even notice.
Now, odds are, you will be able to scare the boars away. Like any wild animal, they would prefer not to fight you. However, in the event that they are pissed, and are hell bent on killing you, I would suggest either some sort of heavy hand implement such as a buck knife, or a hatchet (expect to get pretty messed up if your fighting an animal hand to hand, lmao), or I suggest a large caliber firearm. You've probably seen boar attack videos, where even the lighter 200lbs ones can take two or three shots from a rifle before they fall.
Treat them like any other dangerous animal: try to ignore it-->try to intimidate it-->try to kill it
Or you could ignore this entirely. After all, a few people in the thread are pretty adamant that wild animals that weigh more than you are not dangerous, and 300lbs charging boars can easily be fought off with your bare hands because they once chased a domestic pig. I'll leave it up to to decide which advice is reasonable on this Indonesian basket weaving forum.