Police say the men were standing in front of their vehicle around 11 p.m. Monday when it was hit from behind on Route 5 near the 179 overpass.
The men, one in his 60s and the other in his 30s, were taken to Erie County Medical Center in Buffalo. Their names haven't been released, but police say their conditions are critical.
Police say the charges against the driver of the other vehicle, 28-year-old Thomas Gilray from Hamburg, include driving while intoxicated, vehicular assault and reckless endangerment.
Police say Gilray disregarded an officer securing the scene outside his marked police car, nearly striking him. He refused to submit to a chemical test, and town police obtained a court order to have blood drawn.
He was remanded on $5,000 bail.