Opposition parties in Scotland have urged John Swinney to reverse unpopular cuts to free school meals and flat-rate rail fares after he suffered two defeats at Holyrood. In a major test of the first minister’s minority government, opposition MSPs united behind Conservative motions that condemned decisions to scrap plans to provide free school meals for all primary school pupils and reintroduce peak rail fares. All four parties accused the Scottish government of undermining efforts to combat child poverty and the cost of living crisis by failing to use its money wisely. While the votes have no legislative effect, these defeats highlight the challenges Swinney faces getting his budget passed in December, after his finance secretary, Shona Robison, unveiled cuts and spending adjustments worth £960m last month. Under Scottish parliament rules, a budget must command a majority of votes – and the Scottish National party is three votes short, after the previous first minister, Humza Yousaf, ripped up a power-sharing deal with the Scottish Greens. Swinney is pinning his hopes on Rachel Reeves, the UK chancellor, increasing funding for Scotland’s devolved government in October. This would allow ministers in Edinburgh to buy support from at least one opposition party by making deals on spending. Liam Kerr, for the Scottish Tories, said Robison’s decision not to extend free school meals to all children in P6 and P7, except for those whose families were in receipt of child benefit, broke an SNP manifesto pledge. “Promises made, promises broken,” he said. Jenny Gilruth, the Scottish education secretary, said ministers wanted to eventually fund the policy, but fully extending free school meals would cost £256m over the next two years. That was unaffordable, she said. Fiona Hyslop, the transport secretary, said the attempt to greatly increase train travel by scrapping peak rail fares had proven too costly. It had increased passenger numbers by 6.8% but had mostly benefited middle earners, while having little impact on overall car usage. Richard Leonard, the former Scottish Labour leader, said Hyslop’s definition of middle earner was insulting, and included nurses, teaching assistants and janitors who had to take trains during peak hours to get to and from work, people who were struggling to make ends meet. Graham Simpson, for the Scottish Tories, said it was essential to keep fares low and simple to understand how to boost rail use, yet now peak fares would effectively double from next week. “If your policy is to get more people on the roads, then this is genius,” he said. Hyslop said Scots made 5bn car journeys every year and the flat-rate fares pilot scheme had cut those journeys by 0.1%, at a cost of £40m.