I'd cut the wires of the old and use a 6 point socket. If not I'd use a flared nut wrench. An open end wrench only had 2 points of contact and will round out that hex on hard to turn items.
View attachment 367388
What? No, don't do this. That solenoid requires the rear axle to be taken apart to be removed correctly.