Could this be The Ghosts (1969) by Antonia Barber?
When Lucy sat in the attic, she thought she heard the sound of voices calling...
That's when she started to believe the rumors in the village that the old house was haunted. But no ghosts appeared - until the day Lucy and her brother Jamie stood in the garden and watched two pale figures, a girl and a boy, coming toward them.
That was the beginning of a strange and dangerous friendship between Lucy and Jamie and two children who had died a century before.
The ghost children desperately needed their help. But would Lucy and Jamie have the courage to venture into the past - and change the terrible events that had led to murder?
The Goodreads synopsis only mentions that the siblings went back in time to save two children who appeared to them as ghosts, and doesn't mention anything about a fire or a grandparent. However, the Wikipedia summary goes into more detail, clarifying that one of the two ghosts was actually the great-great-grandmother of the two siblings living in the present day, and that the siblings manage to save her from a fire started by her adoptive father.
The story opens with an elderly man visiting Mrs. Allen, a widow who lives with her three children Lucy, Jamie and her baby Benjamin, in Camden Town, London, England. He offers her a job as caretaker of an abandoned house, which belonged to the late Mr. Latimer, until the Blunden, Blunden and Claverton company can find the rightful owner. Mrs. Allen takes the job, despite the rumours of ghosts haunting the old house.
One day, Lucy is walking in the garden to explore and to pick flowers when she hears the ghosts calling her name. She goes closer, only to discover the ghosts in person: a teenage girl and her younger brother.
Lucy and Jamie return the next day to discuss with the ghosts. It turns out their uncle is trying to "get rid of them", or murder them, and they are travelling forwards in time in order to get help. The ghosts' names are Sara and Georgie Latimer.
By drinking an infusion of various leaves, made from a recipe that Sara provides, Lucy and Jamie go back in time with the ghosts to meet Mrs. Wickens, the housekeeper and mother to Bella who is to marry Sarah and Georgie's guardian, and Tom, the gardener's boy. The children also meet Mr. Blunden (who is believed to be the creator of Blunden, Blunden and Claverton company), who helps Jamie and Lucy rescue Sara and Georgie from a fire supposedly started by their drunk adoptive father.
In the end, Jamie and Mr. Blunden travel through the fire by holding hands, and because Mr.Blunden is the one who must suffer, Jamie will not have to. They save Georgie while Sara is safely outside.
In the end, a lawyer named Mr.Smith returns to the household. It turns out Sara married Tom (the gardener boy) and emigrated to America, whilst Georgie moved to Camden Town. According to a letter sent by Sara to Georgie, her great-grandson is the late Mr. Allen, Jamie and Lucy's father, so Jamie is considered heir to the house, being Sara Latimer's great-great-grandson.
Also, the cover prominently features a sundial, which is what caught my attention as I was searching for your book.