If you file for bankruptcy and are behind on a public utility bill then you can discharge the arrearage and not lose service.
What happens is the amount you are behind will be discharged in your bankruptcy. Anything you incur for a charge after the date of filing bankruptcy you will be required to pay.
Public utilities include the electrical (National Grid) and gas (NStar) company.
Cable or satellite television and land or cell phones are not public utilities. Your obligation to repay these bills will be discharged in bankruptcy. You may or may not lose service depending on the policy of your provider.
Water and sewer bills attach to your home so those will need to be repaid.