The letter signed by Green MP Caroline Lucas and Labour's Chris Bryant follows a report which said the UK "badly underestimated" the Russian threat.
The parliamentarians argue the prime minister's "lack of action" breaches the right to free elections.
The government said the UK had "robust systems" to protect elections.
In July, Parliament's Intelligence and Security Committee published a long-awaited report into Russian activity in the UK including disinformation campaigns, cyber warfare and the targeting of Russian expatriates in the UK.
It claimed the government made no effort to investigate Russian interference in the 2016 EU referendum and called for "immediate action" including "an assessment of potential Russian interference" in the Brexit vote.
US intelligence chiefs have accused Russia of interfering in the 2016 presidential election and earlier this month they warned that China, Russia and Iran were among the countries seeking to influence this year's vote.
Now a group of MPs and peers in the UK say they will take the prime minister to court if he refuses to take "essential steps to protect future elections".
Describing legal action as "a last resort", the letter urges the PM to "order an independent investigation of Russian interference with the democratic process from at least the 2016 EU referendum".
Ms Lucas, Green MP for Brighton Pavilion, said: "Democratic processes are clearly at risk and it seems that the integrity of our elections is being deliberately undermined."
And Mr Bryant, the Labour MP for Rhondda, said: "The government's refusal to investigate is a complete dereliction of their duty to keep us and our way of life safe."
The group also includes Labour MP Ben Bradshaw, SNP MP Alyn Smith, the Lib Dem peer Lord Strasburger and Baroness Wheatcroft, who resigned from the Conservative Party last year.
A Cabinet Office spokeswoman said: "Safeguarding our democracy will always be an absolute priority and the UK has robust systems in place to protect our elections from interference.
"To prevent any future threats we are bringing forward new legislation to provide the security services and law enforcement agencies with the tools they need to disrupt hostile state activity.
"And we have also published proposals for a digital imprint regime that will improve transparency in political campaigning online, and are developing an online media literacy strategy, to help empower the public to question the information they read online."
Rule No. 1: Never lose money; rule No. 2: Don’t forget rule No. 1.