Ross Chastain took the lead from Martin Truex Jr. on a late restart and won the NASCAR Cup Series race at Kansas Speedway.