They do obey the law: they're required to pull onto a siding to allow Amtrak to stay on time. So the operators ensure the train is too long for any of the sidings, which fits them into an escape clause. Any cargo train stuck waiting for Amtrak simply isn't fully stacked yet.
Closing that loophole is what the government is dragging its feet about.