Lyft Inc. shares surged in late trading after issuing strong earnings guidance for both this quarter and the full year, signaling that the ride-hailing service’s plan to attract more commuters is working.