Tesla Inc. is expanding near its Fremont factory, one of Silicon Valley’s largest recent research-and-development leases.