Not sure if a once-in-awhile machine washing would do the job on the grates— l had scrubbed off a lot of build-up before beginning to put them in every time run it, which is 3 to 4 times a week. It does work like a charm on the burner pans. But hey, give it a try on the burners!
I would wash the grates whenever they get grease splatter on them or some other sort of spill, but the once-in-a-while applies more to the dishwasher since it would not be running every day.
I guess I am fortunate the previous owner left the cooktop in good shape & the grates didn’t have any buildup on them & I intend to keep them that way.