The National Union of Rail, Maritime and Transport Workers (RMT) said it would now consider whether to launch a walkout which could disrupt services over the festive period. It said the ballot had delivered an overwhelming mandate.
But the result was attacked as "deeply disappointing" by ScotRail which pointed out that, of the 2200 RMT members eligible to vote, only 24% had supported strike action.
It promised to run as many trains as possible in any dispute. More than 95% of services were unaffected during the last RMT strike in 2010.
The RMT said its executive would now consider its next step and called on ScotRail to reinstate Scott Lewis immediately in order to resolve the dispute.
The ticket collector was dismissed for gross misconduct following an argument with a passenger travelling to Prestwick in March who had tried to claim a free travel offer as part of a Ryanair promotion.
ScotRail accused Mr Lewis of using "aggressive and intimidating" behaviour which reduced the passenger to tears.
But the RMT said Mr Lewis had been trying to help the passenger, who was described as a "fare dodger" in a leaflet distributed by the union.
Bob Crow, general secretary of the RMT, said: "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 a single shred of evidence to support their case, and that is why they have delivered this overwhelming mandate for action in this ballot."
Of those balloted, 548 voted in favour of strike action and 264 against, with seven ballot papers spoiled. There was a higher level of support for industrial action short of a strike, which was backed by 81% of those who voted. Turnout was 37%.
The company issued a strongly-worded reaction to the ballot, saying if staff thought such intimidating and aggressive behaviour towards a passenger was justified "they are in the wrong job".
As revealed by The Herald last week, the two sides have clashed over controversial CCTV footage showing an argument between Mr Lewis and the passenger.
A spokesman for ScotRail said: "The images underpin the dismissal on grounds of intimidating and aggressive behaviour towards a passenger, who was reduced to tears during the incident.
"If anyone believes such conduct towards a customer is acceptable – let alone worthy of a strike – then they are in the wrong job. The ticket examiner also had a compete disregard of correct ticket procedures."
The RMT would have to give seven days' notice before any industrial action was held, making the earliest strike date December 6.