If companies invent the tech, the governments will be able to use it no matter what. 90% of all the things China is using are based on Silicon Valley research. Plus, even if you don't let TSA or the police have the scanners, it would still be possible to subpoena companies for your latest thoughts as they happen.
/The only/ way to not allow this to be the absolute end of privacy is to have the technology be shaped in an incredibly ethical way that makes such privacy violations fundamentally impossible.
Store close to no data. Constantly encrypt whatever data you do store and keep it on the device itself. Constantly cycle keys. Make brain scanners absolutely worthless unless the user consciously authenticates themselves.
Requiring all brain scanners to be 100% fully open (full on GPLv3 including the hardware plans) and physical networking kill switches would be a good start.
All of this is not even new advice - there are quite a few outspoken people out there against any sort of data collection. But whether you agree with them or not, you must agree that the line in the sand must be drawn somewhere - and it definitely should not allow collecting people's thoughts.
Trying to extend the Google and Facebook model of siphoning as much of your data as possible to also include thoughts should literally be a crime against humanity.