After losing a difficult battle in Sacramento last year over a law that could classify their drivers as full-time employees, Lyft Inc. and Uber Technologies Inc. are signaling they are ready to spend big against California legislators who opposed them.

Lyft has placed $2 million in a campaign account taking aim at Tyler Diep, an Orange County assemblyman who was the sole Republican to vote for the law, known as AB5, according to campaign-finance records. Uber has contributed $200,000 to a PAC that opposes Mr. Diep, who faces...