Massachusetts is launching a first-of-its-kind statewide vehicle-to-everything (V2X) pilot program that will run for two years.