Former UK Transport Secretary Stephen Byers has taken the stand in London's High Court and denied that he engineered the collapse of Railtrack.
Allegations about the demise of Railtrack have stalked Mr Byers
Mr Byers said that he put public interest first and did not abuse his position or act unlawfully.
About 50,000 shareholders want £157m in compensation after the firm in charge of running the UK's rail infrastructure collapsed in 2001.
They allege that the government deliberately allowed the firm to fail.
"These are very serious allegations without foundation in fact and are simply wrong," Mr Byers said.
Answering questions from the shareholders' lawyer, Mr Byers said that he was "prepared" to reverse the privatisation of Railtrack if it was in the best interests of the public and rail travellers.
"But in doing that, I did not abuse my position, I did not act unlawfully," he said.
Mr Byers added that he "had regard to the interests of Railtrack shareholders".
The court case, the UK's largest ever group action, is in its second week.
It is a complex wrangle, with disgruntled shareholders alleging "misfeasance", whereby the government and Mr Byers are said to have acted within the law but in bad faith.
They also claim a breach of human rights for confiscation of assets.
At the heart of the case is whether Railtrack - since replaced by the state-backed not-for-profit Network Rail - ran out of money or whether the government took a secret and malicious decision to destroy the company.
Critics complain that by withholding state support, Railtrack was renationalised by the backdoor.
The government has always said the firm was not capable of running the railways and was insolvent without its support.
It denies killing off Railtrack and said it withdrew financial support and rescue plans because the financial state of Railtrack had deteriorated.
Last week, Railtrack's former chairman John Robinson denied that he had told Mr Byers, during a meeting, that the firm was in a worsening financial situation.
He also pointed out that Railtrack was asking for less support than is currently given to its successor, Network Rail.
Mr Byers has a different recollection of the meeting, and points to it as a key moment when he was made aware of how serious Railtrack's situation had become.
The BBC's transport correspondent Tom Symonds says the trial is an "an unprecedented case, and one which includes evidence from the secret heart of Whitehall".
Small shareholders are angry that the value of their investment in Railtrack, formed in April 1994 after the privatisation of the UK railway network by the then Conservative government of John Major, plummeted.