Agreed. The railroads on the East Coast tend to require a 1% maximum grade for any non-railroad related realignments. But they are willing to raise/lower tracks if the project is managed well and coordinated carefully with other railroad projects along the same trackage route. Oftentimes, the local authorities do not properly inform the railroad about highway projects that interfere with railroad operations until those projects are fully funded (and sometimes until they are well along in the design phase). Most of the railroad's capital projects departments are booked out many years in advance. It is a mess to hire employees for one or two projects, because they get a massive severance when they are laid off permanently.
The railroads increasingly want "more stuff" as time goes on to make them whole with a project. Years ago, railroads would be happy if the state built a plain new replacement railroad bridge and paid for it. One of my former co-workers was complaining about a rail overpass in IL that was originally built and maintained by the railroad over a 2 lane highway. The state is planning on adding 2 lanes to the highway, and is willing to pay $10M for a replacement bridge and associated temporary and permanent track work that will have room for a third track if the railroad ever needs one. Not good enough for the railroad, they want to put the state at permanent liability to maintain the bridge for the next 100 years and replace it at state cost if it ever wears out. The railroad is apparently taking the position "you guys want the extra lanes, we don't care about them" and is trying to squeeze every last nickel out of the state.
Indeed, railroads get quite defensive over the "who was there first" legal precedence. They also get aggravated when a DOT expects the railroad to design and construct an 85-foot long structure over a new four-lane road in 12 months at a cost that is less than a third of what the DOT would design and construct a similar-sized structure to much less intense AASHTO standards. Quite frankly, $10M doesn't pay for that bridge structure itself, much less the trackwork associated with the project. Plus, you should expect at least $5M to $10M extra if any of the railroad signalling needs to be relocated. But I certainly understand why the local folks are upset about the "you guys want the extra lanes, we don't care about them" mentality.
It is for this reason that North Carolina is literally dotted with hundreds of two-lane underpasses beneath the railroads, with four-lane at-grade bypasses fully equipped with CFL&G (cantilevered flashing light signals and gates). The additional cost of widening the underpass was simply not cost effective.
Here in North Carolina, the NCDOT Rail Division is responsible for coordinating all rail crossing work (which includes existing underpasses and overpasses). They often serve as an advocate for the railroads, which I believe is unique. So the DOT or municipality here gets a well-planned, properly-budgeted project set up by the NCDOT Rail Division before the railroad ever gets involved in the political part. This is oftentimes too expensive. Furthermore, when the North Carolina Rail Road became a real estate investment trust, they started protecting their right-of-way by disallowing any new pavement and forcing NCDOT to grade separate rather than widened at grade. This is almost always too expensive, but the Class I railroads here (Norfolk Southern and CSX) do pitch in additional funds for each crossing that is closed due to the grade separation.