Roy, minister of state for shipping, took the oath of office and secrecy Tuesday morning as cabinet minister at a ceremony held at Rashtrapati Bhavan.
Several union ministers and leaders from other political parties were present at the ceremony headed by President Pratibha Patil.
Trivedi had to resign after Trinamool Congress chief Mamata Banerjee opposed the hike in passenger fares announced by him in the rail budget presented in parliament last week.
Banerjee had written to the prime minister that Trivedi should be replaced by Roy.
Trivedi sent his resignation to the prime minister Sunday evening.