From their point of view it was a good plan - given JLR is owned by Tata who had the resources to bail them out and didn't they (Tata) likely see it as a good deal.
Late stage capitalism in action as usual - privatise the profits, socialise the costs.
Technically what the government did was underwrite the loan but again - why is the government underwriting the loan when Tata has the resources to do that (13bn net income at last FY).