DETROIT — The Detroit 3 have been working to fend off challenges from tech companies that want to disrupt the auto industry, and General Motors CFO Dhivya Suryadevara's sudden departure shows that automakers have to compete with Silicon Valley for executives as well as for customers.