This should be caught by the creditors in the bankruptcy proceeding. In particular, in construction, the "service" tends to create an asset. They would want to know that they are collecting against the asset. If the asset was not present in the bankruptcy, then they would investigate the actual ownership. If they could prove fraud (e.g. the bankrupt company actually operating as an agent of one of its owners in purchasing improvements from which it itself did not benefit), they could then collect from the owners of the asset instead.
It's also possible that they could investigate this prior to offering the service. If the service is never performed, then it's not possible to discharge it via bankruptcy. So no fraud. Or they could demand payment in advance or payment by escrow.
Even just making some human being sign an agreement attesting to the facts would make it easier to collect later.
Consider a potential fraudster. We'll call him Richie McDuck, so as not to make accusations against any actual human being. Richie creates two companies: Richie's Fake Co. and Richie's Real Co. He decides to build a mall and asks a construction company to do the actual labor. The construction company writes up a legal agreement. In that agreement, it asserts that Richie's Fake Co. is the legal owner of the property and the mall. If Richie signs the agreement and it turns out that the real owner is Richie's Real Co., then the construction company can sue Richie for fraud.
A more likely outcome is that Richie would refuse to sign the agreement and respond with a more accurate description. The construction company could then amend the agreement so that instead of billing Richie's Fake Co., they could bill Richie's Real Co. Then they don't care if Richie's Fake Co. declares bankruptcy.
This works because everyone knows that Richie is the real owner of the mall, regardless of what companies are involved. So having Richie sign the agreement guarantees that there is someone who can be pursued for collection of payment in case of misrepresentation.
The upfront cost for creating a corporation is low enough ($2k-$3k)
That seems rather high actually. I would expect something more like $200-$600 in the United States. For example, Legal Zoom charges $149-$369 plus "state filing fees" to register an LLC or corporation. Perhaps you are including other costs beyond the initial creation.