If you check the documentation of Google Maps Directions API using the parameter mode=transit or transit_mode=bus, they did not specify the service number of vehicles that will be used in the transit mode.
If you check the Transit Details of the documentation, it contains the following field line that contains information about the transit line used in this step, and may include the following properties:
name contains the full name of this transit line. eg. "7 Avenue Express".
color contains the color commonly used in signage for this transit line. The color will be specified as a hex string such as: #FF0033.
agencies contains an array of TransitAgency objects that each provide information about the operator of the line.
short_name contains the short name of this transit line. This will normally be a line number, such as "M7" or "355".
vehicle contains the type of vehicle used on this line. This may include the following properties:
name contains the name of the vehicle on this line. eg. "Subway".
type contains the type of vehicle that runs on this line. See the Vehicle Type documentation for a complete list of supported values.
icon contains the URL for an icon associated with this vehicle type.
local_icon contains the URL for the icon associated with this vehicle type, based on the local transport signage.
Note: I think this short_name can give you the service number, if
you check in your sample request, it will give you a "short_name" :
"500D", which it is available in your sample screenshot.