But the war wouldn't have ended with the deaths of the Longbottoms, in that case. The reason that Voldemort disappeared after he tried to kill Harry was that Snape asked him spare Lily before he ran off to Dumbledore, gave him the warning, and agreed to spy for him. Lily was given the choice to step aside but she didn't, which activated the sacrificial protection.
If Voldemort went after the Longbottoms, there would have been no sacrificial protection because neither Frank nor Alice would have been asked to step aside, so Voldemort would still be around. Snape being guilted into switching sides (ie, when Dumbledore accused him of not caring about the deaths of Harry and James, he just shut off) meant that he did care about the deaths of Harry and James on some level. If Voldemort had gone after the Longbottoms I don't think Snape would have switched sides for the sake of protecting them, but if they and their baby were killed because of the prophecy that may have shocked some sense into Snape (his soul was intact by HBP, he wasn't a killer) and awakened his conscience. Kind of like how Draco only realized the Death Eaters were bad news after his multiple failed attempts at killing Dumbledore and realizing he was in danger of getting killed, but he still nearly killed Katie and Ron in the process. Whether that shock or guilt alone would have been enough to get him to leave the Death Eaters, I don't know, but it's clear that things were escalating in terms of the Death Eater's brutality. If Lily hadn't died but the war still raged on, I think he would have tried to find a way out and go into hiding, or else killed himself if it got too much.