In shemirat shabbat (eng vol 3 43:17) it says that if the nerot shabbat do not last enough to get any usage out of it is a bracha in vain
Is this not a contradiction to what we know (and it says) elsewhere that if one is away for shabbos there are different opinions about where to light, according to some one should light at home according to others one should light where one is going; but “mema nafshach” either way one is not getting the benifit from the lights; but we dont say that this is a bracha in vain?
The purpose of the Shabbos candles is for benefit of the light (either for kavod shabbos, for ones shabbos, or for shalom bayis), and if no benefit is derived from the candles, the beracha is indeed considered to be in vain. If a person goes away for Shabbos, he can only light at home (with a beracha) if he will be returning at night, and will benefit from the candles. If he is not returning at night, and will not derive benefit from the candles, he may not light at home, and must light where he is going to be for Shabbos.
Sources: Shulchan Aruch 263:9; accoriding to Shulchan Aruch Harav (263:11), one can even recite a blessing over the lighting of a non-Jew on one’s behalf, because the purpose of the lighting is to benefit from the light (he therefore rules like Maharash, who writes that one can light by means of a non-Jew and even make a berachah, though other authorities, including Mishnah Berurah, express doubts over the ruling). A similar ruling emerges from Shemiras Shabbos Kehilchasah (vol. 2, chap. 43, no. 31), which states further (no. 17) that when the candles will not last until night, it is sufficient that one derives benefit after one accepts Shabbos upon oneself, even though this is before nightfall.