SAN FRANCISCO—Uber Technologies Inc. was considering buying the driverless-car startup of a former Google engineer two days after he resigned from the tech giant, and was already anticipating a lawsuit if it did, attorneys for Google parent Alphabet Inc. said in federal court here on Wednesday.

The assertion, backed by an email discussed Wednesday, is consistent with allegations by Google’s driverless-car unit, Waymo, that Uber and the former engineer, Anthony Levandowski, were in contact around the time of his departure from...