The easiest way to remove them is with an air impact gun.
Ride your bike to a shop and ask if someone will remove them for you (takes about 30 seconds).
If you buy something at the parts counter, ask the counter person if someone can do it for free (since you bought something there they might accommodate you)
This is how bar ends are held in place.
There is a solid rubber cylinder about 1" long that slides into the inside of the handlebar.
The screw at the end of the bar end goes through
the rubber cylinder, then a washer & nut.
When the screw is tightened, the rubber cylinder gets compressed, squished - expanding the outside diameter, getting tight against the inside of the handlebar.
When you try to loosen the screw with ordinary hand tools, the nut at the end of the rubber cylinder spins (there's nothing holding it in place).
The previous answer gave a good tip to forcibly press against the bar end.
You might get lucky if you put a screwdiver bit in a hand drill.
The fast spinning motion might be enough to keep the nut from spinning.