The Meiji Restoration wasn't just an event that happened at 5:17PM on a Tuesday one year. It was a process that happened over time to "restore practical imperial rule to Japan ... under Emperor Meiji". Given that wars also aren't instant, there's a 3rd possibility that wasn't allowed for in the question framing: they happened at overlapping times.
But in fact, the relation is even stronger than that. The Wikipedia page for the Boshin War, down in the 3rd paragraph, refers to the war as "the military phase of the Meiji Restoration". In other words, the war was part of the Restoration, not some separate event happening at a different time.
As for the timing of the Restoration, you have a point. It looks like 1868 is picked because that's when the new government first met after the Shogunate ended. However, it looks like the beginning of the serious organized pushback against the Shogunate was in 1866:
The foundation of the Meiji Restoration was the 1866 Satsuma-Chōshū
Alliance between Saigō Takamori and Kido Takayoshi, leaders of the
reformist elements in the Satsuma and Chōshū Domains at the
southwestern end of the Japanese archipelago. These two leaders
supported the Emperor Kōmei (Emperor Meiji's father) and were brought
together by Sakamoto Ryōma for the purpose of challenging the ruling
Tokugawa shogunate (bakufu) and restoring the Emperor to power.
The "Restoration" period itself was more of an ongoing thing from that point, rather than something that completed and then all the changes stopped. There was even another war in the 1870's which threatened to end the modernization, had it been successful.
You'd certainly end the period by the surrender at the end of WWII, but late Imperial Japan was so different than Japan at the end of the Boshin War that it doesn't seem reasonable to consider it as part of the same historical era.
I'd say good candidates for calling a definitive end to the Restoration period would include:
- The Meiji Constitution which went into effect in 1890.
- The signing of the Japan-Korea treaty in 1910, after which Japan was a true imperial power.
- The death of Meiji in 1912.
I'm a big believer in the cultural impact of how power flows in your government, so I'd probably go with the 1890 number.