Saudi Arabia and Taiwan's Foxconn Technology Group are in talks to form a joint venture to build electric vehicles, a move that could help accelerate plans by the oil-dependent kingdom to diversify its economy, according to people familiar with the matter.