Rivian is locked in a legal fight with the world’s largest automotive supplier over motors in the R1 pickup truck and SUV as the electric vehicle maker grapples with ongoing production issues.