Two companies in Greater Lowell have agreed to preliminary memorandums of terms that may grant them both tens of millions of dollars in federal funding through the CHIPS and Science Act.