A second ship came under attack Wednesday in the Strait of Hormuz, the British military said, just a short time after Iran’s paramilitary Revolutionary Guard opened fire on a container ship.