I think railway or construction companies do just create some corporation for each project, so it can't be illegal per se. What's going to stop you from just creating a company for each project (splitting when projects become to large). You can also keep a reasonable number of companies around and just allocate tasks and resources as necessary.
I actually believed that having a ton of subcompanies, IS already how any larger company operates.