Trains are returning to normal following disruption caused by a trespasser on the railway in the Gloucester area.