Thanks for the clarification!
It also seems like babylon considers the material when exporting to gltf. A mesh with standard material is converted to gamma space and pbr material stays as is. This means, I can write my vertex colors in linear space to a mesh with pbr material without worrying about gltf export.
Sounds good
The following playground shows, what happens, if I write gamma space colors to a mesh. Even though the vertex colors in code are the same for pbr and standard material, the exported version knows about linear and gamma space.