Yoni Barrios, an unauthorized immigrant whose unprovoked attack on eight people in 2022 drew attention from Donald J. Trump, will serve life in prison without the possibility of parole.