A company has been fined £2.6 million after an employee was killed when the trench he was working in collapsed on him in Lancashire.