I've never heard of the government locking the phone (maybe some of the more restrictive countries have that ability?). A simple reboot should get it out of safe mode.
I'm wondering if that "government lock" is some sort of ransomware made to look like an official lock. If you can, please join the site so you can reply to this thread and give us some more details. It would be especially helpful to know which device, carrier, country location, and if you could take a photo of the lock notice and upload it here.