According to my experience, using Terminal to erase the USB drive is a way worth trying. However, if the drive still refuses to be erased because of encryption, try Secure Erase with Disk Utility in Recovery Mode or use diskutil secureErase in Terminal (this usually bypasses the “writable disk required” issue).
Also, make sure no Finder window is accessing the drive while doing this. If you see errors, reboot your Mac, plug the drive in, and try again without mounting the volume before erasing.
Worst case, if it’s really corrupted, use diskutil partitionDisk to re-partition it from scratch.