Inhomogeneous distribution of crosslinks in ion tracks in polystyrene and polysilanes