Members of the Rail Maritime and Transport union (RMT) will walk out on December 22 and again two days later, warning of "massive disruption" to services.
Union members on the firm's sleeper services will also strike for 24 hours from the evening of December 21 and again from the evening of December 23.
The union said the action was in support of Scott Lewis, who the RMT claimed had been dismissed for trying to help a member of the public buy the correct ticket.
RMT members voted last month by 2-1 in favour of industrial action, but the dispute has remained deadlocked.
The union maintained that Mr Lewis was trying to make sure the passenger had the correct ticket, but he was dismissed for making "unwanted contact" with the man.
General secretary Bob Crow called for immediate reinstatement, adding: "Scott Lewis has been victimised and sacked for trying to help a passenger within the written procedures set out in ScotRail's own policies in what is an absolute travesty of justice.
"RMT members will not sit back and watch while their colleagues are picked off in this fashion by a management who think that they can fire staff without as single shred of evidence to support their case, and that is why RMT had no choice but to announce this programme of action."
ScotRail said the dates were a "clear attack" on the travelling public across Scotland at Christmas, as well as shoppers and people heading home from England.
The firm warned that the action was designed to extend disruption over four days by targeting Caledonian Sleepers to and from London on the weekend before Christmas as well as services in Scotland on Christmas Eve.
A spokesman said: "This reeks of selfishness, designed to give those on strike extra time off and full wages while having the maximum impact on the travelling public in the run-up to Christmas.
"It also appears mercenary and opportunistic to choose times when families and friends will be travelling for festive reunions and many other people, including staff in hospitals and shops, still have to get to and from work.
"The union should immediately call a halt to this cynically timed and unjustified strike, especially when only 24% of its members voted for such action.
"Our customers come first, and we have contingency plans in place to run as many services as possible over the dates which cover one of the busiest days for last-minute Christmas shopping and key times for travel to be with family and friends.
"We will also ensure that all Sleeper ticket holders get home for Christmas.
"If anyone believes the conduct towards a customer, who was reduced to tears, is acceptable - let alone worthy of a strike - then they are in the wrong job. The ticket examiner also had a complete disregard of correct ticket procedures."