There is a warning to the government in the latest official figures on research and development: they reveal that most of the research is being done by the three industries most vulnerable to Brexit.

Another red flag is the UK’s 11th-place ranking in the European R&D league – behind the Nordics, France and Germany, which we have come to expect, but also, surprisingly, Austria, Slovenia and the Czechs.

The three industries at risk are pharmaceuticals, aerospace and cars. Between them they spent £9.4bn on R&D in 2016, which was almost half of the £22.2bn spent by business in total.

The UK car industry, which is almost entirely foreign-owned, has already made its concerns clear to business secretary Greg Clark. It wants to move parts around Europe without barriers, either in the form of tariffs or extra administration.

The company to watch is Jaguar Land Rover (JLR). It is a largely diesel car company in a world where diesel is dying. It is Britain’s largest carmaker, with an annual output of more than 640,000 vehicles. Where will its Indian owners – Tata Group – build a new generation of electric cars? The decision is due this year. Already Tata has commissioned Magna, a Canadian car parts maker, to build the first model under contract at sites in Austria. The i-Pace is due to appear in the autumn.

JLR has told Clark that he needs to spend £450m on infrastructure in the Midlands before it even considers retooling factories in Solihull, Coventry and Wolverhampton. Clark is known to be in talks with the Treasury and the Tory mayor of the West Midlands, Andy Street, and has handed Street £31m to fund the testing of driverless cars on the region’s roads. He is also considering an £80m bid for a battery research institute in Coventry. It’s all good stuff, but he has some way to go before he hits £450m.

Meanwhile, JLR is building a £1bn factory in Slovakia. It isn’t clear if the plant is gearing up to work with Magna, but there is every chance Austria and Slovakia will become the centre of JLR’s electric ambitions.

That would be a huge blow to the West Midlands, the UK and the chancellor, Philip Hammond, who is only too aware of the UK’s woeful record on R&D spending.

Last November, Hammond said he wanted to push total R&D spending from 1.67% to 2.4% of GDP, past the EU average of 2.06%, to leave the UK in sixth place. He promised to release an extra £2.3bn in 2020-21, which he said could be added to the £4.75bn extra in his budget plans for the next three years. The 2.4% target is due to be reached in 2027 and the extra costs he is incurring are among the reasons Hammond is on course to miss his balanced-budget target in 2025.

For years, pharma companies have milked the EU’s R&D budget, using it to subsidise some of their most basic research

All his extra money is going on investment, leaving nothing spare to ease welfare cuts or boost spending on health, prisons or the police. The Institute for Fiscal Studies has warned the chancellor that his plans are heroic and risk a huge backlash.

The heroism stems from the task of shifting the UK from a pattern of spending that has locked R&D investment at 1.7% of GDP or thereabouts for 30 years – and that Hammond wants to channel funds to industry by imposing the longest period of austerity in history.

Much of Clark’s focus is on the pharmaceutical industry, as it was Vince Cable’s when he was business secretary in the coalition. To keep it happy, he will need to come up with even more money than demanded by the motor bosses.

For years, pharma companies have milked the EU’s R&D budget, using it to subsidise some of their most basic research. With Pfizer’s decision to pull out of the UK, almost all pharma research is being done by GlaxoSmithKline and AstraZeneca. They are unlikely to up sticks when Brexit hits, especially as they are embedded in projects with Cambridge University and other institutions. Yet, over time, there could be an acceleration in the current leaching-away of research to cheaper locations.

Aerospace firms also benefit from the EU’s R&D grants, but their major concern is long-term investment. That’s why Airbus threatened to withdraw all its business from supplier GKN if it succumbs to a takeover by Melrose – a firm with a reputation for wringing businesses dry before selling them on.

This month, Airbus also warned it would need to consider its position in the UK without clarity over customs rules after Brexit. Factories in north Wales were at risk, executives told MPs last year. It also said factories could soon consider stockpiling parts to avoid border delays – adding costs that could make UK operations uncompetitive.

It is hard to see how Hammond can generate the laudable step-change he wants in R&D spending amid austerity and Brexit. Something will have to give. Maybe it should be his deficit target.