The oil industry is challenging new federal rules intended to improve the safety of oil-by-train transportation, opening the first legal fight in a two-year effort to reduce the risks of moving hazardous materials on railroads.

The American Petroleum Institute, the industry’s main trade group, petitioned the United States Court of Appeals for the District of Columbia Circuit to block key provisions of the rules, which were unveiled this month by Anthony Foxx, the transportation secretary. The petition was filed on Monday.

The trade group, which represents companies like Exxon Mobil and Chevron, has long argued that forcing oil producers and shippers to use newer tank cars and replace older models would impose high costs on the industry and lead to a shortfall in tank car capacity.

The petition challenges the government’s timeline to upgrade or retrofit older tank cars with new safety features designed to prevent them from spilling oil or rupturing in a derailment. It also challenges a requirement that tank cars be equipped with new electronic braking systems or face operational restrictions.