California is a "jungle primary" state, in which multiple candidates from all parties (and No Party Preference) compete in the first round, with the top two vote-getters advancing to the general election.
CA-34: Mejia faced only incumbent Democrat Jimmy Gomez and a Libertarian candidate. It's a very diverse & progressive district. Mejia, who received about 12% Tuesday, says he's running to win, but it will be quite an accomplishment if he whittles down Gomez's 79% primary showing.
CA-40: Cortes Barragan faced only incumbent Democrat Lucille Roybal-Allard, so a two-two finish was guaranteed. He received about 19.6% of a small vote pool.
They're not going to win over many dyed-in-the-wool Democrats in their respective districts, so they'll be focusing on people who didn't vote Tuesday—or who have just given up on voting. In the 2014 general election, the vote count in District 34 was only about 61,000; in District 40, it was under 50,000. Each of these districts has about 400,000 eligible voters. There's a whole lot o' non-votin' goin' on there.