By Geoffrey Rogow

BNSF Railway, one of the largest operating units of Berkshire Hathaway Inc., named Kathryn Farmer as chief executive on Monday.

With the appointment, Mrs. Farmer will become the first female CEO of a major railway operator in North America. She is also now one of the highest ranking women at Berkshire, Warren Buffett's Omaha conglomerate that owns a large insurance operation, utilities, industrial manufacturers, retailers and auto dealerships. Berkshire's Ben Bridge Jeweler, Fruit of the Loom and General Re also have women as chief executives.

Mrs. Farmer, 50 years old, will succeed Carl Ice as chief executive. Mr. Ice had been at the firm for 42 years. Mrs. Farmer has been with BNSF for 28 years, most recently serving as executive vice president of operations. The handover is effective at the end of the year.

In an interview, Mrs. Farmer said she would continue Mr. Ice's management strategy by focusing on efficiency and cost controls.

"That has always been our business model and will continue to be our business model," she said.

The appointment of Mrs. Farmer is the latest in a series of recent high-level transitions at Berkshire. Among them, late last year, Berkshire named Todd Combs as CEO of car insurer Geico.

The larger issue of Berkshire succession remains one of the most talked about in the financial world. Mr. Buffett, who has led Berkshire for more than 50 years, has yet to name a successor but has released some details of plans, with money managers Mr. Combs and Ted Weschler expected to take over all of Berkshire's investments once Mr. Buffett is no longer in the top job. Either vice chairmen Greg Abel or Ajit Jain is expected to succeed Mr. Buffett as CEO.

In the interim, many of the more than 60 businesses owned by Berkshire are wrestling with their own succession plans.

BNSF Railway transports everything from consumer goods and agricultural products to petroleum and chemicals. In the most recent second quarter, operating earnings for Berkshire overall fell to $5.5 billion from $6.1 billion in the year prior. Profits increased within the company's vast insurance operations, but railroad, utilities and energy declined.

North America's freight railroads have mostly switched to a new operating model in recent years where the companies run fewer, longer trains to help cut costs and operate more efficiently. The change improved profitability for operators, and the companies say the more nimble operating structure has helped them adjust faster to the wild swings in shipping volume in the wake of the pandemic.

Railways have attracted buyers, with Kansas City Southern recently rejecting a roughly $20 billion bid to buy the railroad from Global Infrastructure Partners and the infrastructure arm of private-equity giant Blackstone Group Inc.

The 90-year-old Mr. Buffett, whose shrewd investments have earned him the nickname "the Oracle of Omaha," has plenty of cash on hand should the firm look to make a railroad acquisition of its own. Berkshire held $146.6 billion in cash at the end of the second quarter, up from about $137.3 billion in cash at the end of the first quarter.

BNSF has refrained from following peers such as CSX Corp. and Union Pacific Corp. in adopting what is known as precision scheduled railroading, which irritates some shippers due to rigid operating requirements. In February, Mr. Buffett said in a CNBC interview that BNSF was picking up customers from other railroads due to the new operating plans while also having comparable operating margins.

Mrs. Farmer said BNSF has felt the impact of the pandemic through lower volumes, but that it has continued to provide a crucial role in ensuring the transportation of goods.

"To be able to weather the ups and downs of the economy...we have to have as productive a railroad as possible," said Mrs. Farmer.

Mr. Ice said he and Mrs. Farmer had been working toward this succession plan "for a long time." Mr. Abel noted that Mrs. Farmer fits Berkshire's larger succession thinking in that she was developed within the company and has had multiple roles at the firm.

"We look forward to Katie's leadership and more success," said Mr. Buffett in a press release. "She possesses all of the qualities that make us excited about the future."

Paul Ziobro contributed to this article.

Write to Geoffrey Rogow at geoffrey.rogow@wsj.com

Corrections & Amplifications

This article was corrected at 6:20 p.m. ET to reflect that Carl Ice has been at BNSF Railway for 42 years. The original version incorrectly said he had been at the company for 41 years.