Lateral isolation by refilling of trenches with polycristalline material