Strike action planned for Melbourne's train network next week has been averted after the Rail, Tram and Bus Union and Metro Trains came to an agreement on key terms in their pay dispute.

The two parties had been locked in talks all day after the union on Wednesday moved to stop work for four hours next Thursday and implement a ban on checking tickets on grand final day.

The last train arrives at Caulfield station before the strike on September 4. Credit:Joe Armao

As part of a week of planned industrial action, staff had pledged to, at various times, refuse to wear uniforms, or drive trains until public address systems and headlights were tested.

The strike would have been the third train strike to hit Melbourne in a month, after staff walked off the job twice earlier in September.