And therein lies the problem. Nobody wins in a pyrrhic victory. Apple can waste enormous resources on passive-aggressive shenanigans, or they can draw a line in the sand and take it to court. IANAL, but I suspect doing that after the court case is liable to land you in contempt.
Thing is, Apple will always lose, going to court is not going to change it (but of course it also delays the thing). No judge will rule for Apple and against the FBI, no way.
They will never win, and they will not be able to not comply with the order.
But you can comply one way or the other. They can delay the process, and they can make the victory so bitter for the FBI that it will be hard to swallow. And, they can do the same thing again when the next one (say, City of NY who wants to read some pimp's messages) comes. Yeah, they can just subpoena, whatever. But Apple is not required to keep the source code of the OS image they gave to the FBI. So, unluckily, when the next one comes -- which they couldn't possibly anticipate -- they will need to start over again from scratch. Which will, again, take years. Unluckily.
To begin with, they can appeal because this directly threatens their business (the order even explicitly says that). The appeal will of course be turned down, but following that, they can still comply with the order in the most perverted possible way. Just so much that you can't say they aren't following it.
So, the FBI will win, inevitably, but Apple can delay this for a very, very long time, which is massively bad propaganda for the government every time the subject comes up again. If, against all odds, Trump is not elected, it might even happen that after two years of this shot going on and on, the president says: Oh please guys, just the fuck stop it, I can't hear this any more.
Eventually, the effect on the general public will make a difference, too. Many people probably still kind of agree (or don't care) because after all it's just one phone and the FBI is hunting terrorists. Which is what you want them to do, right.
Give it 3-4 years of shenanigans and repeated mention that it's not just one phone, and that many other people who aren't hunting terrorists would like to read another few thousands of phones already have put on their Stasi badges, and it soon becomes "unaffordable" for a politician. Time totally plays against them.