Here the distances from charge q to A and B is different. So the charge density is different at A and B.
The field is the effect due to charge and the field is proportional to inverse square of distance between source point and measure point. As distance is different so field at A ≠ field at B.
Since, potential inside a conductor is constant so VA=VB
By Gauss's law , the flux ϕ=qenclosedϵ0=qϵ0