In the short term it might matter somewhat, but in the long term you are in control.
To have a career in education policy you have to get hired, probably by some school of education or department of education within a school. For some places the specialties will be silo-ed to some (maybe a great) extent, and for those places your initial job would probably have expectations that you can produce in curriculum and instruction. If there are no silos, such as a general department of education, then you might just get hired to produce in education generally.
In the long term, however, if you can get tenured, then you can define pretty much what you do, especially in research, though you may be expected to teach courses outside your specialty, as most people must.
There are, I'm sure, plenty of places that don't have strict subfield silos. If your job search is focused there, then it might not matter at all, either short or long term.
I'm assuming that the general research process in the two fields is pretty much the same: gathering data and using statistics to analyze it. Something similar is likely required to produce good curriculum and to produce good policy. It would be harder if the process were very different, though still not entirely impossible. Math and history are pretty far apart in process for most things.