Railroad workers are being offered signing bonuses of up to $25,000 to join BNSF Railway and Union Pacific Corp. as the freight railroads struggle to fill jobs in a historically tight labor market.

BNSF and Union Pacific are hauling more products across the Western U.S., where their networks are based, and trying to ease congestion in areas with high demand. Freight volumes are rising on strong economic growth and industrial expansion, and a shortage of available truck capacity is pushing more shipments onto rails.

At...