Perth and Kinross Council officials had recommended refusal because of the loss of parking spaces and pedestrian safety concerns.
However, members of the planning and development management committee voted 7-5 to approve the scheme following a two-and-a-half hour discussion.
The decision is subject to 11 spaces in the car park on which the carriages will be sited being replaced elsewhere.
Local councillor John Duff said: “It is an innovative, exciting and long overdue opportunity for Pitlochry.”
As The Scotsman revealed in January, pharmaceuticals marketing executive Fergus McCalIum and his Thai beautician wife Isara plan to open the 60-seat restaurant with their 18-year-old daughter Mia this summer.
He said: “We literally roared with pride to live in a democracy where elected officials of whatever persuasion weigh up the evidence and have the courage to hold officials to proper scrutiny.
“Full steam ahead – we have jobs to create to live up to the trust that the councillors had in us.”
A total of 44 diners will be accommodated in one carriage, with the remaining 16 seats in the other one, along with the takeaway area.
The two carriages will be restored to their original 1980s-era British Rail interior decor and sited on a specially-laid section of track.
They remained in service until a few years ago on Great Western Railway in south-west England before being scrapped.
Similar carriages have been refurbished by ScotRail for use in trains which run through Pitlochry.
The Pitlochry couple have already had the carriages repainted in their original British Rail blue and white external livery by a specialist firm.
Four jobs are expected to be created from the restaurant venture, to be called The Wee Choo Choo, which they hope to open in June.
Several councillors expressed concern about road safety in the car park, but others said the scheme was an economic development opportunity too good to miss.
Approval is subject to the McCallums contributing to replacement of the lost parking spaces elsewhere in Pitlochry.
Councillor Callum Purves, who proposed approval of the planning application, said it was an example of “destination tourism” that would attract visitors to the town and create jobs in an area particularly badly affected by Covid-related redundancies.
He said: “It is a unique experience which would bring people in who would not otherwise have come to Pitlochry.”
However, Councillor Tom Gray said: “Removal of parking spaces for an enterprise which is likely to generate parking space requirements makes no sense whatsoever.”
He said the carriages should instead be positioned at the far end of the car park from the pedestrian entrance to the station to minimise road safety concerns.
The McCallums plan to market the restaurant to rail enthusiasts by advertising through ScotRail, including on board its trains.
Some 30,000 people a year are expected to visit the restaurant, a third from outside the local area.
The carriages are of the same type and vintage as those which ScotRail has refurbished as Inter7City trains, which run through Pitlochry between Edinburgh, Glasgow and Inverness – feet away from the McCallums’ planned restaurant.