The GDL union announced that the strike would end at 6pm on Saturday.
Earlier in the day a state court rejected rail operator Deutsche Bahn's attempt to gain an injunction to halt the strike.
The strike threatened to stop millions of people from travelling to Berlin.
"The employers have completely failed in their attempt to curb our constitutional rights," said union leader Claus Weselsky.
He added that curtailing the strike, which was due to end early on Monday, was a "gesture of conciliation".
GDL is calling for a 5% pay rise and a working week cut to 37 hours. But it has been widely criticised for rejecting mediation.
The German train drivers' union is cutting short its four-day strike which looked set to disrupt celebrations to mark the 25th anniversary of the fall of the Berlin Wall.