Border officials floated using a “heat ray” against migrants after President Trump demanded “extreme action” on immigration before the 2018 election.