Years ago I watched a couple get married in the Sightseer lounge on the Cardinal as we passed through the New River Gorge. The conductor sort of closed off the chairs on one side of one end of the upper level. The conductor performed the ceremony and later told me that he'd done a few other weddings in the past. All the adults in the lounge got free champagne out of the deal too!
One does have to make prior arrangements with Amtrak to do this; but it is allowed and possible.
I can't speak to the legal issues, especially the state line issue. But obviously it is possible even if one has to wait for a particular state in which to do it.
The state probably have no way of knowing exactly when state/county lines are crossed, but has that ever stopped alcohol service on Amtrak?
I looked at West Virginia law. They have interesting laws on where a prospective married couple must get their license, but a nonresident couple could get their license at any county clerk in the state. Now they seem to be restrictive about who can perform a wedding - only a "religious representative" or a WV judge of some sort, and anyone authorized to perform a marriage must be listed with the state. Not quite like California where it's a list as long as my arm and where someone could simply come into the state, sign the license, and leave. Just curious what authority the conductor would have other than maybe as a "religious representative". At least in California almost any adult can be deputized for a day as a deputy civil marriage commissioner.