Actually, at virtually all crossings it IS considered trespassing, as the rail lines more often than not predate the existence of the roads that cross the rights-of-way; it's legally an easement, private property with public access granted at the discretion of the property owners (such as in city sidwalks where you see plaques in the pavement indicating "right to pass at owner's discretion")
I agree with some of what you said, but not with other aspects. Public highway grade crossings are easements, but they are not discretionary. Those easements are ordered by the government, usually state, to provide for the public good. The public is granted access across the railroad property. Persons or vehicles using a grade crossing are doing so within the terms of the easement and are not trespassing in any legal or other definition of the word. The railroads are not just being good neighbors.
One other clarification. The property plaques set in sidewalks are not defining pedestrian easements (quite the opposite) nor are they intended to limit liability. The purpose of those plaques is to define a private property line for a specific and unique reason.
There is almost always a specific setback from a street that is public property. Most often this is the area where sidewalks are located. But sometimes with large buildings there is additional sidewalk width provided by the building owner, or maybe even a public court area. These areas are open to the public but are actually on private property. It is legally necessary to publicly establish property rights to these areas to avoid the future imposition of a legal right called Adverse Possession. Simply put, Adverse Possession is a legal doctrine that states that if a property owner allows anyone to use their property for any purpose adverse to private property rights for a specified period of time, usually 21 years, and that property owner does nothing to prevent that use and advise those using the property of the ownership, then those using the property (an individual, a group, or the general public) are deemed to have established an easement on that property for that use and the owner cannot evict those using the property or prevent future use by them.
In the case of a building, maybe the public right-of-way extends 10 feet behind the curb line but for whatever reason the building installed a 15 foot wide sidewalk. Unless the building owner publicly establishes the private ownership of that extra five feet, after 21 years that extra five foot area, having been used as a public sidewalk for all those years, would in fact become legal, public right-of-way and the property owner would lose any right to use that property for any other purpose.
That is why those little plaques are there. They say "this is private property, not a public thoroughfare" and establish public notice of private property rights to prevent the 21-year Adverse Possession clock from starting to tick.