The nonbinding pledge targets the conversion of all new medium- and heavy-duty truck sales by 2040.