Section 40H. If any corporation subject to regulation by the department of public utilities or the department of telecommunications and cable is aggrieved by the adoption of airport approach regulations under section forty A, or by a direction to lower, remove, reconstruct or equip a structure under section forty F, or by the taking of its property or rights in property under section forty G, or by refusal to grant a variance permit as provided in section forty D, such corporation, within thirty days after such adoption, direction, taking or refusal, may appeal to said department, and if, after notice and a hearing, said department determines that the public safety, necessity and convenience will be best served by the amendment or annulment of such regulation, direction or taking, it may order such regulation, direction or taking to be amended or annulled, or may grant a variance permit as prescribed in section forty D.