The Department of Homeland Security will miss an initial deadline of July 12 to comply with a sweeping federal law meant to thwart terrorist attacks arriving by sea, frustrating border security advocates who worry that the agency has not done enough to prevent dangerous cargo from coming through the country’s ocean gateways, including the Port of Boston.