The transport secretary has questioned whether the firm’s dismissal of 800 staff was legal.