Section 41. A railroad corporation, for the purpose of building a branch or extension, or of aiding in the construction of another railroad, or of taking stock in a grain elevator corporation in the organization of which it is an associate, or of erecting and operating grain elevators within the commonwealth, or of building depots, or of abolishing grade crossings, or of making permanent investments or improvements, or of funding its floating debt, or of refunding its funded debt, or for the payment of money borrowed for any lawful purpose, or for other necessary and lawful purposes, may, from time to time, in accordance with sections forty-seven and forty-eight, increase its capital stock or bonds beyond the amounts fixed and limited by its agreement of association or its charter, or by any special law.