Yes, but.
Those 16-inch guns and even the bigger Paris Gun of WW I that could throw a shell 80 miles using a ballistic trajectory taking the rounds nearly to the stratosphere, in the case of the Paris gun, to get around the curve of the earth.
The speeds of a railgun will give its projectile a very shallow ballistic curve. The speed is so high and the ballistic path so shallow that railguns have been looked at to launch small satellites.
Trying to hit a target hundreds of miles away while threading the needle between a shallow ballistic path following the curve of the earth or shooting out into space may be technically feasible, but is it worth doing from the rolling deck of a ship?
One more point. The video clearly shows they do not trust the targeting capabilities to be more than a few feet from the target. For how long they have been testing this you would think they would be shooting at targets a few hundred feet away by now.