NSW Government has passed legislation to allow for the trial of automated vehicles on both city and regional roads across the state.