The Guggenheim Museum announced Tuesday that it had reached an agreement with its workers’ union after more than two years.