No it's not mandatory that work contract to Govt will be B2B supply. if Govt is not supplying goods or services further is not liable to get Registered in GST . yes to deduct GST TDS , it's mandatory for govt to obtain Registration as GST Deductor . So even if the govt concern is Registered as TDs (GST) Deductor then supplier will raise B2C invoice only .
Note : Plz go through the contract letter can find GSTN (as regular dealer) of Govt therein & can do the billing accordingly.