The union that represents the engineers who drive New Jersey Transit’s commuter trains has threatened a walkout as soon as Friday if a contract deal is not reached.