When charging a metal object with induction, another charged object is brought near to that neutral metal object but it is not touched. This will make the electrons move within the metal object according to polarity of the charged object. Keep in mind that opposite charges attract one another whereas like charges repel. This movement of electrons creates an imbalance of charge on opposite sides of the neutral metal object. When the charge is separated within the metal object, and a ground is contacted to one of the sides of the metal object, a flow of electrons between the object and the ground will start.
Now back to your example: In the left diagram, electrons will flow from the ground to the metal object and make it negatively charged. Because the ground is connected where the positive charges accumulated on the metal object. In the right diagram, the electrons in the metal object will flow to the ground as the ground is connected where they accumulated and this will make the metal object positively charged.