Though if Labour does not do a second referendum and is heading towards Brexit even reluctantly, that could help it retain some seats it lost OTL because the Tories can't play the Brexit card (more importantly, "look at how THEM in power want to override YOUR vote") while it might lose some it retained. So we end up with quite a different political landscape.
This would be true if Labour were able to get in to government, then pass a withdrawal agreement without committing to a second referendum. But in practice, it would be very difficult to do that, seeing as most viable coalition partners would likely insist on it as a condition of supporting a Labour government, and even if that wasn't an issue, there would still be an extremely large minority of the PLP who would not support a withdrawal agreement without it. And that's before we get on to the defection of remain voters to the Lib Dems that we saw IOTL.
Because of those factors, Corbyn would probably end up backing a second referendum, and the damage that does to Labour in leave areas would if anything be worse than IOTL, as he would forced to push it more actively in parliament. If he succeeds in legislating, then he is the man who made a second referendum happen, if he fails, then he is perceived as a weak PM pushing an insufficiently hard Brexit without even being able to command the support own party-like May was in her last months. Such a scenario might enable Labour to do slightly better among Remainers than IOTL, but there would not be any real improvement in their position among leavers.
Though, thought occurs: one thing that seems needed to give Labour more seats would be the Lib Dems doing better at nabbing Tory seats, which means them doing better in general. Which means either Fallon needs to better handle the questions on how he feels about gay sex, or that manages to not come up, or he's not leader. IIRC, he was big on the Lib Dems being the no-Brexit party, so if it's option 3 does this mean Leave/Remain is still as big a factor or is it more Soft/Hard? The latter's probably better for Labour's chances. (But then, where do the hard remainers go??)
.
The Lib Dems could probably gain several seats simply by reducing the Tory vote share. Even if those votes go to Labour or someone else rather than them, it would still lower the bar needed to elect a LD. I seem to recall that there were at least three seats where they came within a couple of hundred of votes of winning.
I think it's possible to overstate the part that Farron played in getting a second referendum on the agenda. Most Lib Dems were in favour of it, and there was also significant support for the idea among Labour MPs (even in 2017), the commentariat, and sections of the public that would enable it to develop into a major movement in the same way it did IOTL-so it would eventually become an important issue regardless.
Lamb (who was a second referendum sceptic) beating Farron in 2015 would have interesting implications for the Lib Dems-but I don't think it would result in a significant upturn in their fortunes compared to OTL. Remain feeling among Lib Dem activists would likely create a situation similar to the one in Labour where the grassroots drag the leadership toward a second referendum (albeit at a faster pace) creating significant divisions which weaken the party's standing among voters. I'm not sure whether Lamb would have enough support to lead the LDs into 2017 without committing to a referendum, but even if he did somehow manage too, they would still suffer in leave voting areas simply by the fact that they would still be seen as a Remain party. After all, Labour weren't committed to a referendum in 2017, but they still went backward in many leave areas. And at the same time, not committing strongly enough to Remain would likely make it significantly harder for the Lib Dems in many of the seats they did best in IOTL-especially in SW London and Scotland.
Still, I'm not really convinced that a better Lib Dem performance is absolutely necessary for a Labour government. Labour's momentum at the time was such that they probably would have been the largest party had the campaign lasted a week longer, especially as that would mean that the country would be going to the polls the day after Grenfell. A Scotland related PoD that prevents the Tories from making gains up there on its own would be enough to make a Labour government viable as well.