Mr Lomax, 93, was tortured by the Japanese during the Second World War but eventually met and forgave one of his tormentors, Nagase Takashi, and wrote about his experiences in the book The Railway Man.
The best-selling book has inspired the film version, with Firth playing Mr Lomax and Nicole Kidman cast as his wife Patti, 75, which is due to be released next year. The stars met the Lomaxes at their home in Berwick during research for their roles.
Firth said after the meeting he had been moved by Mr Lomax's story: "The story is such a big one and about a generation prior to my own, it can feel a bit abstract, a little bit out of reach. But to meet Eric personalised it and humanised it. You do feel a little overwhelmed by the enormity of the story you are trying to tell."
Mr Lomax's story and the reconciliation with one of his captors had become a symbol of Christian forgiveness.
Canon Alan Hughes, vicar of Berwick, who said prayers at Mr Lomax's bedside yesterday with Patti, paid tribute to his achievements.
He said: "He was one of those amazing individuals who had seen the worst of humanity and yet was the best of human beings and the most forgiving."
Fans of The Railway Man also paid tribute on Twitter.
Mr Lomax, who was born in Edinburgh, had hoped to see the film version of his book on the big screen next year. For many years after his experiences, the Strathclyde University lecturer had remained bitter, describing himself as impossible to live with, but later spoke about the power of forgiveness.
"Forgiveness is possible when someone is ready to accept forgiveness," he said. "Some time the hating has to stop."
Mr Lomax was captured by the Japanese in Singapore in February 1942 while serving with the Royal Signals. Along with thousands of other prisoners of war (PoWs), he was sent to the notorious Changi camp and from there forced to work on the infamous Thailand/Burma railway.
Mr Lomax and other PoWs built a radio in a bid to find out how the war was progressing and a detailed map of the surroundings which they hoped could be used in an escape attempt.
However, the radio was dis-covered and Mr Lomax and some of the other conspirators were interrogated and beaten for a week.
He was later told by a surviving PoW that the rest of the camp had lain awake all night listening to the cries for mercy but could only pray they would survive.
"We survived but only just," said Mr Lomax. "I had both my arms broken."
Mr Lomax's book of the story, which was published in 1995, has now sold half-a-million copies and has been translated into many languages, including Japanese. Work on the movie version of the story began in April this year, with Kidman and Firth travelling to Edinburgh for location filming.
Oscar-winner Firth said Mr Lomax had a tremendous sense of humour which could sometimes be a little dark. "He's incredibly approachable, as much as a person can be on a subject like that."